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-7 of 7 results.

A025441 Number of partitions of n into 2 distinct nonzero squares.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A060306 gives records; A052199 gives where records occur.
Column k=2 of A341040.
Cf. A004439 (a(n)=0), A025302 (a(n)=1), A025303 (a(n)=2), A025304 (a(n)=3), A025305 (a(n)=4), A025306 (a(n)=5), A025307 (a(n)=6), A025308 (a(n)=7), A025309 (a(n)=8), A025310 (a(n)=9), A025311 (a(n)=10), A004431 (a(n)>0).

Programs

  • Haskell
    a025441 n = sum $ map (a010052 . (n -)) $
                          takeWhile (< n `div` 2) $ tail a000290_list
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    Table[Count[PowersRepresentations[n, 2, 2], pr_ /; Unequal @@ pr && FreeQ[pr, 0]], {n, 0, 107}] (* Jean-François Alcover, Mar 01 2019 *)
  • PARI
    a(n)=if(n>4,sum(k=1,sqrtint((n-1)\2),issquare(n-k^2)),0) \\ Charles R Greathouse IV, Jun 10 2016
    
  • PARI
    a(n)=if(n<5,return(0)); my(v=valuation(n, 2), f=factor(n>>v), t=1); for(i=1, #f[, 1], if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); if(t%2, t-(-1)^v, t)/2-issquare(n/2) \\ Charles R Greathouse IV, Jun 10 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A025441(n):
        f = factorint(n).items()
        return -int(not (any((e-1 if p == 2 else e)&1 for p,e in f) or n&1)) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 0 # Chai Wah Wu, Sep 08 2022

Formula

a(A025302(n)) = 1. - Reinhard Zumkeller, Dec 20 2013
a(n) = Sum_{ m: m^2|n } A157228(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019
a(n) = Sum_{i=1..floor((n-1)/2)} c(i) * c(n-i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020
a(n) = A000161(n) - A093709(n). - Andrey Zabolotskiy, Apr 12 2022

A071383 Squared radii of the circles around (0,0) that contain record numbers of lattice points.

Original entry on oeis.org

0, 1, 5, 25, 65, 325, 1105, 4225, 5525, 27625, 71825, 138125, 160225, 801125, 2082925, 4005625, 5928325, 29641625, 77068225, 148208125, 243061325, 1215306625, 3159797225, 6076533125, 12882250225, 53716552825, 64411251125
Offset: 1

Views

Author

Hugo Pfoertner, May 23 2002

Keywords

Comments

The number of lattice points (i,j) on the circle with i^2 + j^2 = a(n) is given by A071385(n).
In a sci.math posting on May 05 2002 entitled "Circle with 3 lattice points", James R. Buddenhagen asked: Which circles have the property that they pass through more lattice points than any smaller circle? and he gave the terms 1, 25, 65, 325, 1105, 4225, 5525, with the missing 5 added by Ahmed Fares. In the same thread Gerry Myerson mentioned the factorization into primes of the form 4*k+1.
Also, numbers with a record number of divisors all of whose prime factors are of the form 4k + 1. - Amiram Eldar, Sep 12 2019
Indices of records of A004018. Apart from the first term, also indices of records of A002654. - Jianing Song, May 20 2021

Crossrefs

Cf. A000448, A048610, A052199, A071384, A071385, A230655, A300162. Subsequence of A054994 (excluding first term). Where records occur in A004018. See A088959 for circles with integer radius.
Indices of records of Sum_{d|n} kronecker(m, d): A230655 (m=-3), this sequence (m=-4), A279541 (m=-6).

Programs

  • PARI
    my(v=list(10^15), rec=0); print1(0, ", "); for(n=1, #v, if(numdiv(v[n])>rec, rec=numdiv(v[n]); print1(v[n], ", "))) \\ Jianing Song, May 20 2021, see program for A054994
    
  • Python
    from math import prod
    from sympy import isprime
    primes_congruent_1_mod_4 = [5]
    def prime_4k_plus_1(i): # the i-th prime that is congruent to 1 mod 4
        while i>=len(primes_congruent_1_mod_4): # generate primes on demand
            n = primes_congruent_1_mod_4[-1]+4
            while not isprime(n): n += 4
            primes_congruent_1_mod_4.append(n)
        return primes_congruent_1_mod_4[i]
    def generate_A054994():
        TO_DO = {(1,())}
        while True:
            radius, exponents = min(TO_DO)
            yield radius, exponents
            TO_DO.remove((radius, exponents))
            TO_DO.update(successors(radius,exponents))
    def successors(r,exponents):
        for i,e in enumerate(exponents):
            if i==0 or exponents[i-1]>e:
                yield (r*prime_4k_plus_1(i), exponents[:i]+(e+1,)+exponents[i+1:])
        if exponents==() or exponents[-1]>0:
            yield (r*prime_4k_plus_1(len(exponents)), exponents+(1,))
    n,record,radius=1,1,0
    print(radius, end="") # or record, for A071385
    for radius,expo in generate_A054994():
        num_points = 4*prod((e+1) for e in expo)
        if num_points>record:
            record = num_points
            n += 1
            print (",", radius, end="") # or record, for A071385
            if n==27: break
    print()
    # Günter Rote, Sep 12 2023

Formula

For n>1 we have 1 < a(n+1)/a(n) <= 5, since one can multiply the points x+iy for which x^2 + y^2 = N by either 2+i or 2-i to get two new sets of points X+iY for which X^2 + Y^2 = 5N. This strictly increases the number since it is easy to see that the two sets aren't the same. - J. H. Conway, Jun 04 2002
lim n ->infinity Log(a(n))/n = 1. [Conjectured by Benoit Cloitre, proved by J. H. Conway]

A048610 Smallest number that is the sum of two positive squares in >= n ways.

Original entry on oeis.org

2, 50, 325, 1105, 5525, 5525, 27625, 27625, 71825, 138125, 160225, 160225, 801125, 801125, 801125, 801125, 2082925, 2082925, 4005625, 4005625, 5928325, 5928325, 5928325, 5928325, 29641625, 29641625, 29641625, 29641625, 29641625, 29641625
Offset: 1

Views

Author

Keywords

Examples

			2 = 1^2 + 1^2; 50 = 1^2 + 7^2 = 5^2 + 5^2; 325 = 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 50, p. 19, Ellipses, Paris 2008.
  • J. Meeus, Problem 1375, J. Rec. Math., 18 (No. 1, 1985), p. 70.
  • Problem 590, J. Rec. Math., 11 (No. 2, 1978), p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    (* Assuming a(n) multiple of 1105, from 1105 on, to speed up computation *) twoSquaresR[n_] := twoSquaresR[n] = With[{r = Reduce[0 < x <= y && n == x^2 + y^2, {x, y}, Integers]}, If[r === False, 0, Length[{x, y} /. {ToRules[r]}]]]; a[n_] := a[n] = For[an = a[n - 1], True, an = If[an < 1105, an + 1, an + 1105], If[ twoSquaresR[an] >= n, Return[an]]];a[1] = 2; Table[ Print[a[n]]; a[n], {n, 1, 30}] (* Jean-François Alcover, Jun 22 2012 *)
    nn = 10^6; t2 = Table[0, {nn}]; n2 = Floor[Sqrt[nn]]; Do[r = a^2 + b^2; If[r <= nn, t2[[r]]++], {a, n2}, {b, a, n2}]; t = {}; n = 1; While[a = Position[t2, ?(# >= n &), 1, 1]; a != {}, AppendTo[t, a[[1, 1]]]; n++]; t (* _T. D. Noe, Jun 22 2012 *)

A300162 Numbers of the form n^2 + 1 that can be expressed as j^2 + k^2, j > k > 1, in more ways than any smaller number of this form.

Original entry on oeis.org

65, 325, 2210, 17425, 58565, 71825, 986050, 2458625, 15657850, 27636050, 205005125, 343842850, 1930020625, 4401924410, 5279766245, 26189596225, 109020153125, 1997821114250, 3001878503650, 5283874574225, 10991001911825, 91178970317825, 253647605037125
Offset: 1

Views

Author

Hugo Pfoertner, Feb 27 2018

Keywords

Examples

			See A300161.
		

Crossrefs

Extensions

a(17) from Hugo Pfoertner, Mar 08 2018
a(18)-a(21) from Robert Price, Mar 10 2018
a(22)-a(23) from Giovanni Resta, Mar 13 2018

A088959 Lowest numbers which are d-Pythagorean decomposable, i.e., square is expressible as sum of two positive squares in more ways than for any smaller number.

Original entry on oeis.org

1, 5, 25, 65, 325, 1105, 5525, 27625, 32045, 160225, 801125, 1185665, 5928325, 29641625, 48612265, 243061325, 1215306625, 2576450045, 12882250225, 64411251125, 157163452745, 785817263725, 3929086318625, 10215624428425, 11472932050385, 51078122142125
Offset: 1

Views

Author

Lekraj Beedassy, Dec 01 2003

Keywords

Comments

These are also the integer radii of circles around the origin that contain record numbers of lattice points. See A071383 for radii that are not necessarily integer. - Günter Rote, Sep 14 2023

Examples

			From _Petros Hadjicostas_, Jul 21 2019: (Start)
Squares 1^2, 2^2, 3^2, and 4^2 have 0 representations as the sum of two positive squares. (Thus, A088111(1) = 0 for the number of representations of 1^2.) Thus a(1) = 1.
Square 5^2 can be written as 3^2 + 4^2 only (here A088111(2) = 1). Thus, a(2) = 5.
Looking at sequence A046080, we see that for 5 <= n <= 24, only n^2 = 5^2, 10^2, 13^2, 15^2, 17^2, 20^2 can be written as a sum of two positive squares (in a single way) because 5^2 = 3^2 + 4^2, 10^2 = 6^2 + 8^2, 13^2 = 5^2 + 12^2, 17^2 = 8^2 + 15^2, and 20^2 = 12^2 + 16^2.
Since A046080(25) = 2 and A088111(3) = 2, we have that 25^2 can be written as a sum of two positive squares in two ways. Indeed, 25^2 = 7^2 + 24^2 = 15^2 + 20^2. Thus, a(3) = 25.
For 26 <= n <= 64, we see from sequence A046080 that n^2 cannot be written in more than 2 ways as a sum of two positive squares.
Since A046080(65) = 4, we see that 65^2 can be written as the sum of two positive squares in 4 ways. Indeed, 65^2 = 16^2 + 63^2 = 25^2 + 60^2 = 33^2 + 56^2 = 39^2 + 52^2. Thus, a(4) = 65.
(End)
		

References

  • R. M. Sternheimer, Additional Remarks Concerning The Pythagorean Triplets, Journal of Recreational Mathematics, Vol. 30, No. 1, pp. 45-48, 1999-2000, Baywood NY.

Crossrefs

Cf. A052199. Subsequence of A054994. Number of ways: see A088111. Where records occur in A046080.

Programs

  • Python
    from math import prod
    from sympy import isprime
    primes_congruent_1_mod_4 = [5]
    def prime_4k_plus_1(i): # the i-th prime that is congruent to 1 mod 4
        while i>=len(primes_congruent_1_mod_4): # generate primes on demand
            n = primes_congruent_1_mod_4[-1]+4
            while not isprime(n): n += 4
            primes_congruent_1_mod_4.append(n)
        return primes_congruent_1_mod_4[i]
    def generate_A054994():
        TO_DO = {(1,())}
        while True:
            radius, exponents = min(TO_DO)
            yield radius, exponents
            TO_DO.remove((radius, exponents))
            TO_DO.update(successors(radius,exponents))
    def successors(r,exponents):
        for i,e in enumerate(exponents):
            if i==0 or exponents[i-1]>e:
                yield (r*prime_4k_plus_1(i), exponents[:i]+(e+1,)+exponents[i+1:])
        if exponents==() or exponents[-1]>0:
            yield (r*prime_4k_plus_1(len(exponents)), exponents+(1,))
    n,record=0,-1
    for radius,expo in generate_A054994():
        num_pyt = (prod((2*e+1) for e in expo)-1)//2
        if num_pyt>record:
            record = num_pyt
            n += 1
            print(radius, end="") # or record, for A088111
            if n==26: break # stop after 26 entries
            print(end=", ")
    print() # Günter Rote, Sep 13 2023

Extensions

Corrected and extended by Ray Chandler, Jan 12 2012
Name edited by Petros Hadjicostas, Jul 21 2019

A060306 Records in A025441.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 9, 10, 12, 16, 18, 20, 24, 32, 36, 40, 48, 64, 72, 80, 96, 108, 128, 144, 160, 192, 216, 256, 288, 320, 384, 432, 480, 512, 576, 640, 768, 864, 960, 1024, 1152, 1280, 1440, 1536, 1728, 1920, 2048, 2304, 2560, 2880, 3072, 3456, 3840, 4096
Offset: 1

Views

Author

Lekraj Beedassy, Mar 26 2001

Keywords

Comments

Number of ways in which n-th number expressible as sums of 2 distinct nonzero squares in more ways than any smaller integer may be so represented.

Crossrefs

Cf. A025441. Where records occur in A025441 is A052199.

Formula

a(n) = A025441(A052199(n)).

Extensions

More terms from Randall L Rathbun, Jan 18 2002
Edited and extended by Ray Chandler, Jan 12 2012

A052377 Primes followed by an [8,4,8]=[d,D-d,d] prime difference pattern of A001223.

Original entry on oeis.org

389, 479, 1559, 3209, 8669, 12269, 12401, 13151, 14411, 14759, 21851, 28859, 31469, 33191, 36551, 39659, 40751, 50321, 54311, 64601, 70229, 77339, 79601, 87671, 99551, 102539, 110261, 114749, 114761, 118661, 129449, 132611, 136511
Offset: 1

Views

Author

Labos Elemer, Mar 22 2000

Keywords

Comments

A subsequence of A031926. [Corrected by Sean A. Irvine, Nov 07 2021]
a(n)=p, the initial prime of two consecutive 8-twins of primes as follows: [p,p+8] and [p+12,p+12+8], d=8, while the distance of the two 8-twins is 12 (minimal; see A052380(4/2)=12).
Analogous sequences are A047948 for d=2, A052378 for d=4, A052376 for d=10 and A052188-A052199 for d=6k, so that in the [d,D-d,d] difference patterns which follows a(n) the D-d is minimal(=0,2,4; here it is 4).

Examples

			p=1559 begins the [1559,1567,1571,1579] prime quadruple consisting of two 8-twins [1559,1567] and[1571,1579] which are in minimal distance, min{D}=1571-1559=12=A052380(8/2).
		

Crossrefs

Formula

a(n) is the initial term of a [p, p+8, p+12, p+12+8] quadruple of consecutive primes.
Showing 1-7 of 7 results.