login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179622 n such that n is the sum of previous numbers found using n's digits as offsets. 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 19, 18, 28, 27, 37, 36, 46, 45, 55, 46, 91, 101, 92, 137, 147, 138, 183, 193, 184, 138, 321, 331, 322, 276, 459, 469, 460, 414, 597, 459, 928, 919, 873, 1056, 918, 1387, 1378, 1332, 1515, 1056, 1974, 2443, 2434 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,11
LINKS
FORMULA
For n < 10, a(n) = 1.
For n >= 10, a(n) = a(n - first nonzero digit of n) + a(n - second nonzero digit of n) + ... + a(n - last nonzero digit of n).
EXAMPLE
a(10) = a(10 - 1), nonzero digits in n are skipped.
a(12) = a(12 - 1) + a(12 - 2).
a(312) = a(312 - 3) + a(312 - 1) + a(312 - 2).
MATHEMATICA
a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = a[9] = 1; a[n_] := Block[{s = Select[ IntegerDigits@ n, # > 0 &]}, Plus @@ (a[n - # ] & /@ s)]; Array[a, 63] (* Robert G. Wilson v, Aug 23 2010 *)
PROG
(Python)
def A179622(up_to_n):
sequence=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
for n in range(len(sequence), up_to_n+1):
seed_of_new_element=[-int(x) for x in str(n).replace("0", "")]
new_element=sum(list(map(sequence.__getitem__, seed_of_new_element)))
sequence.append(new_element)
return sequence
A179622(63) # Bence Bernáth, Nov 08 2022
(Python)
from functools import cache
@cache
def a(n): return 1 if n<10 else sum(a(n-int(i)) for i in str(n) if i!='0')
print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Nov 12 2022
CROSSREFS
Sequence in context: A334387 A051503 A331375 * A367617 A367366 A285757
KEYWORD
nonn,base
AUTHOR
Dominick Cancilla, Jul 20 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 10:51 EDT 2024. Contains 372196 sequences. (Running on oeis4.)