login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343265
a(n) is the number of ways n can be reached starting from 0 and using only two operations: adding one or, once n > 1, squaring.
0
1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
OFFSET
0,5
FORMULA
a(n) = a(n-1) + a(sqrt(n)) if n is a square or a(n-1) otherwise.
MATHEMATICA
a[0]:=1; a[n_]:=If[IntegerQ[Sqrt[n]], a[n-1]+a[Sqrt[n]], a[n-1]]; Table[a[n], {n, 0, 80}] (* Stefano Spezia, May 06 2021 *)
CROSSREFS
Cf. A097046.
Sequence in context: A350174 A000196 A111850 * A059396 A108602 A305025
KEYWORD
nonn
AUTHOR
James P. B. Hall, Apr 09 2021
STATUS
approved