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.
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
Keywords
Crossrefs
Cf. A097046.
Programs
-
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 *)
Formula
a(n) = a(n-1) + a(sqrt(n)) if n is a square or a(n-1) otherwise.