cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A102548 Number of positive integers <= n that are expressible in the form u^2+v^2, with u and v integers.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 7, 8, 8, 8, 9, 10, 11, 11, 12, 12, 12, 12, 12, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 19, 19, 19, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 24, 24, 25, 26, 26, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 30, 30, 30, 31, 31, 31, 31, 32, 33, 34, 34
Offset: 1

Views

Author

Salvador Perez Gomez (pies314(AT)hotmail.com), Feb 24 2005

Keywords

Examples

			a(8) = 5 because 1 = 0^2 + 1^2, 2 = 1^2 + 1^2, 4 = 0^2 + 2^2, 5 = 1^2 + 2^2, 8 = 2^2 + 2^2, but 3,6 and 7 are not of the form u^2 + v^2, with u and v integers.
		

Crossrefs

Programs

  • Maple
    a := proc(n) local aux,i,m,u,v; aux:=0; for i from 1 to n do m:=floor(sqrt(i/2)); for u from 0 to m do v:=sqrt(i-u^2); if (v = floor(v)) then aux:=aux+1; u:=m; end if; end do; end do; aux; end proc:
  • Mathematica
    a[1]=1; a[n_]:= a[n]= a[n-1] + If[SquaresR[2, n]>0, 1, 0]; Table[a[n], {n,75}] (* Jean-François Alcover, Mar 31 2015 *)
  • PARI
    first(n)= my(v = vector(n + 1), res = vector(n)); res[1] = 1; for(i = 0, sqrtint(n), for(j = i, sqrtint(n - i^2), v[i^2+j^2+1] = 1 ) ); for(i = 2, #res, res[i] = res[i-1] + v[i+1]; ); res \\ David A. Corneth, Jun 05 2020
    
  • Python
    from itertools import count, accumulate, islice
    from sympy import factorint
    def A102548_gen(): # generator of terms
        return accumulate(int(all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items())) for n in count(1))
    A102548_list = list(islice(A102548_gen(),30)) # Chai Wah Wu, Jun 28 2022

Formula

From David A. Corneth, Jun 05 2020: (Start)
A000161(a(n)) > 0.
a(n) = (partial sum of A229062 up to n) - 1. (End)
a(n) = n/sqrt(log n) * (K + B2/log n + O(1/log^2 n)), where K = A064533 and B2 = A227158. In particular, a(n) ~ Kn/sqrt(log n). - Charles R Greathouse IV, Dec 03 2022

Extensions

Name clarified by David A. Corneth, Jun 05 2020

A000692 An approximation to population of x^2 + y^2 <= 2^n.

Original entry on oeis.org

1, 3, 4, 5, 9, 15, 27, 50, 92, 171, 322, 610, 1161, 2220, 4260, 8201, 15828, 30622, 59362, 115287, 224260, 436871, 852161, 1664196, 3253531, 6366973, 12471056, 24447507, 47962236, 94161474, 184983976, 363632192, 715220838, 1407510311
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A064533.
Other population sequences for x^2 + y^2: A000050, A000690, A000691.

Formula

a(n) = (b*2^n / sqrt(n*log(2))) * (1 + c/(n*log(2))) where b=0.764223654... is the Landau-Ramanujan constant (A064533) and c=0.5819486593... is the second-order Landau-Ramanujan constant (A227158) given by c = (1/2) * (1-log(Pi*e^gamma/(2*L))) - (1/4) * D(1) where D(s) = (d/ds)(log(Product_{p prime == 3 (mod 4)} 1/(1-p^(-2*s)))) and L is the Lemniscate constant (A064853) [see (12) in Shanks]. - Sean A. Irvine, Feb 25 2011

Extensions

More terms from Sean A. Irvine, Feb 24 2011
Name clarified by Seth A. Troisi, May 23 2022

A000694 Related to population of numbers of form x^2 + y^2.

Original entry on oeis.org

1, 2, 4, 6, 11, 19, 34, 63, 117, 218, 411, 780, 1487, 2849, 5477, 10562, 20419, 39563, 76805, 149360, 290896, 567321, 1107775, 2165487, 4237384, 8299283, 16268639, 31915437, 62656158, 123088460, 241958676, 475901501, 936544684
Offset: 1

Views

Author

Keywords

Comments

Shanks' paper gives erroneous value a(16)=10555. - Sean A. Irvine, Feb 25 2011

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000691.

Programs

  • Maple
    Digits:=500;
    K:=.764223653589220662990698731250092328116790541393409514721686673
    7496146416587328588384015050131312337219372691207925926341874206467
    8084323063315434629380531605171169636177508819961243824994277683469
    0516235139218719620569053295644670419176349770659569905712938660289
    3858998296105166296089099177929836072973697200640316985128636517347
    3921065768550978681981674707359066921;
    a:=n->round(evalf((2/3)*K*int(1/sqrt(ln(t)), t=1..2^n)));
    # Sean A. Irvine, Feb 25 2011

Extensions

More terms from Sean A. Irvine, Feb 24 2011
Showing 1-3 of 3 results.