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!)
A068571 Number of happy numbers <= 10^n. 5

%I #44 Jan 15 2024 09:37:35

%S 1,3,20,143,1442,14377,143071,1418854,14255667,145674808,1492609148,

%T 15091199357,149121303586,1443278000870,13770853279685,

%U 130660965862333,1245219117260664,12024696404768025,118226055080025491,1183229962059381238,12005034444292997294

%N Number of happy numbers <= 10^n.

%H Bryan Wolf, <a href="/A068571/b068571.txt">Table of n, a(n) for n = 0..1000</a> (first 122 terms from Lambert Klasen)

%H Justin Gilmer, <a href="http://arxiv.org/abs/1110.3836">On the density of happy numbers</a>, arXiv:1110.3836 [math.NT], 2011-2015.

%H Lambert Klasen, <a href="https://web.archive.org/web/20050207092509/http://zero815.xeen3d.de/happy/happy.html">Xeen3d's happy.html</a>.

%H Walter Schneider, <a href="http://web.archive.org/web/2004/www.wschnei.de/digit-related-numbers/happy-numbers.html">Happy Numbers</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HappyNumber.html">Happy Number</a>.

%F From _Bryan Wolf_, Nov 06 2012: (Start)

%F h(n,x) = h(n-1,x-0^2) + h(n-1,x-1^2) + ... + h(n-1,x-9^2) where h() is the number of numbers of length n whose sum of the squares of their digits is x.

%F a(n) is the sum of all h(n, 0 < x <= 81*n), where x is a happy number, plus 1 for 10^n. (End)

%e For n=0, h(0,0) = 1 and h(0,x >0) = 0.

%o (PARI) ssd(n)=n=digits(n); sum(i=1, #n, n[i]^2)

%o happy(n)=while(n>6, n=ssd(n)); n==1

%o a(n)=my(f=n!,s,d); forvec(v=vector(9,i,[0,n]), d=vector(9,i, if(i>8,n,v[i+1])-v[i]); if(happy(sum(i=1,9,d[i]*i^2)), s+=f/prod(i=1,9,d[i]!)/v[1]!), 1); s+1 \\ _Charles R Greathouse IV_, Nov 01 2016

%Y Cf. A007770, A124095, A219667.

%K nonn,base

%O 0,2

%A _Sascha Kurz_, Mar 26 2002

%E More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.de), Nov 03 2004

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 March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)