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.

Previous Showing 21-30 of 45 results. Next

A082607 a(0)=1; for n > 0, a(n) = least k not included earlier such that k*a(n-1) - 1 is a square.

Original entry on oeis.org

1, 2, 5, 10, 17, 26, 37, 50, 65, 34, 13, 25, 41, 61, 85, 113, 145, 122, 101, 82, 293, 634, 1105, 53, 109, 185, 74, 149, 250, 377, 205, 146, 97, 58, 29, 73, 137, 221, 181, 650, 541, 442, 353, 274, 953, 2042, 3541, 5450, 409, 173, 370, 289, 218, 157, 106, 337, 698
Offset: 0

Views

Author

Amarnath Murthy, Apr 28 2003

Keywords

Comments

Conjecture: this is a permutation of A008784. - Robert Israel, Aug 25 2025

Crossrefs

Contained in A008784. Cf. A082608, A082609, A082610, A082611, A082612.

Programs

  • Maple
    N:= 10000: # for terms before the first term > N
    Cands:= select(t -> numtheory:-quadres(-1,t) = 1, [$2..N]): nc:= nops(Cands):
    R:= 1: r:= 1:
    do
      found:= false;
      for i from 1 to nc do
        if issqr(r*Cands[i]-1) then
           found:= true;
           r:= Cands[i];
           R:= R,r;
           Cands:= subsop(i=NULL,Cands);
           nc:= nc-1;
           break
        fi
      od;
      if not found then break fi
    od:
    R; # Robert Israel, Aug 25 2025
  • Mathematica
    l = {1}; Do[k = 1; While[MemberQ[l, k] || !IntegerQ[Sqrt[k*Last[l]-1]], k++ ]; AppendTo[l, k], {n, 50}]; l (* Ryan Propper, Jun 13 2006 *)
  • PARI
    a=[1];print1(1",");for(n=2,100,k=1;f=1;while(f,if(issquare(k*a[n-1]-1),f=0;for(i=1,n-1,if(a[i]==k,f=1)));k++);a=concat(a,k-1);print1(k-1",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), May 01 2007

Extensions

Corrected and extended by Ryan Propper, Jun 13 2006
Definition corrected by R. J. Mathar, Nov 12 2006
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), May 01 2007

A192450 Numbers k such that -1 is not a square mod k.

Original entry on oeis.org

3, 4, 6, 7, 8, 9, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 27, 28, 30, 31, 32, 33, 35, 36, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 55, 56, 57, 59, 60, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 75, 76, 77, 78, 79, 80, 81, 83, 84, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 107, 108
Offset: 1

Views

Author

Keywords

Comments

Contains A002145 as a subsequence.
Numbers that are divisible by 4 or by a term of A002145. - Robert Israel, May 14 2020

Crossrefs

Programs

  • Maple
    filter:= n -> n mod 4 = 0 or member(3, numtheory:-factorset(n) mod 4):
    select(filter, [$1..1000]); # Robert Israel, May 14 2020
  • Mathematica
    Table[If[Reduce[x^2==-1,Modulus->n]===False,n],{n,2,200}]//Union
  • PARI
    for(n=1, 1e3, if(!issquare(Mod(-1, n)), print1(n", "))) \\ Charles R Greathouse IV, Jul 04 2011

A227781 Least number of squares which add to -1 mod n.

Original entry on oeis.org

0, 1, 2, 3, 1, 2, 2, 4, 2, 1, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 2, 2, 2, 4, 1, 1, 2, 3, 1, 2, 2, 4, 2, 1, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 2, 2, 2, 4, 2, 1, 2, 3, 1, 2, 2, 4, 2, 1, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 2, 2, 2, 4, 1, 1, 2, 3, 2, 2, 2, 4, 2, 1, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 2, 2
Offset: 1

Views

Author

Keywords

Comments

Pfister proved that a(p) <= 2 for all primes p; then a(p) is called the stufe of the field Z/pZ.
Conjecture: a(n) = 4 if and only if n is divisible by 8 and a(n) = 3 if and only if n is 4 mod 8. Together with A008784 this would completely define the sequence.

Examples

			a(3) = 2: 1^2 + 1^2 = -1 mod 3.
a(15) = 2: 2^2 + 5^2 = -1 mod 15.
		

References

  • Albert Pfister, Zur Darstellung von -1 Als Summe von Quadraten in einem Korper, J. London Math. Society, 40 (1965), pp. 159-165.
  • A. R. Rajwade, Squares, Cambridge Univ. Press, 1983.

Crossrefs

Programs

  • PARI
    isA008784(n)=if(n%2==0, if(n%4, n/=2, return(0))); n==1||vecmax(factor(n)[, 1]%4)==1
    a(n)=if(isA008784(n),return(n>1)); if(isprime(n), return(2)); if(n%8==0, return(4)); my(N, cur, new, k=1); for(i=1,n\2,cur=N=bitor(1<<(i^2%n),N)); while(!bittest(cur,n-1), new=0; for(i=1,n\2, t=cur<<(i^2%n); t=bitor(bitand(t,(1<>n); new=bitor(new,t)); k++; cur=new); k

Formula

a(n) <= A002828(n-1) <= 4.
a(n) = 1 if and only if n > 1 is in A008784. a(4n) >= 3 for all n.

A045673 Curvatures in diagram constructed by inscribing 2 circles of curvature 0 and 1 inside circle of curvature 0, continuing indefinitely to inscribe circles wherever possible.

Original entry on oeis.org

0, 1, 4, 9, 12, 16, 24, 25, 28, 33, 36, 40, 49, 52, 57, 60, 64, 72, 73, 76, 81, 84, 88, 96, 97, 100, 105, 108, 112, 121, 124, 129, 136, 144, 145, 148, 153, 156, 160, 168, 169, 172, 177, 180, 184, 192, 193, 196, 201, 204, 216, 217, 220, 225, 228, 232
Offset: 0

Views

Author

Keywords

Comments

Appears to be a superset of {A008784 - 1}. - Ralf Stephan, Jan 26 2005
See A189226 for additional comments, references, links, examples, and crossrefs. - Jonathan Sondow, Aug 24 2012

Crossrefs

A076948 Smallest k such that nk-1 is a square, or 0 if no such number exists.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 0, 0, 0, 0, 5, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 13, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Amarnath Murthy, Oct 20 2002

Keywords

Crossrefs

Cf. A008784.
Cf. A037213.

Programs

  • Haskell
    a076948 1 = 1
    a076948 n = if null qs then 0 else head qs
                where qs = filter ((> 0) . a037213 . subtract 1 . (* n)) [1..n]
    -- Reinhard Zumkeller, Oct 25 2015
    
  • Mathematica
    a[n_] := Module[{r, j, k}, r = Solve[j>0 && k>0 && n k - 1 == j^2, {j, k}, Integers]; If[r === {}, Return[0], Return[k /. (r /. C[1] -> 0) // Min]]]; a[1] = 1;
    Array[a, 100] (* Jean-François Alcover, Apr 27 2020 *)
  • PARI
    a(n) = if (!issquare(Mod(-1, n)), 0, my(k=1); while (!issquare(n*k-1), k++); k); \\ Michel Marcus, Apr 27 2020

Formula

a(n) != 0 if and only if n is a term of A008784. - Joerg Arndt, Apr 27 2020
a(n) = 1 if and only if n is a term of A002522. - Bernard Schott, Apr 27 2020

Extensions

Edited and extended by Robert G. Wilson v, Oct 21 2002

A090736 Number of positive integers <= n that can be expressed as a sum of 2 coprime squares > 0.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Benoit Cloitre, Jan 18 2004

Keywords

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 100

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[Boole[n > 1 && IntegerExponent[n, 2] < 2 && AllTrue[FactorInteger[n][[;; , 1]], Mod[#, 4] < 3 &]], {n, 1, 100}]] (* Amiram Eldar, May 08 2022 *)
  • PARI
    a(n)=sum(i=1,n,if(sum(u=1,i,sum(v=1,u,if(abs(u^2+v^2-i)+abs(gcd(u,v)-1),0,1))),1,0))

Formula

a(n) is asymptotic to (3/(8*K))*n/sqrt(log(n)) where K is the Landau-Ramanujan constant (A064533).

A126949 Moduli n for which -1 is a (nontrivial) power residue for some power greater than 2, i.e., m^k == -1 (mod n) for some k > 1 and some 1 < m < n-1.

Original entry on oeis.org

5, 7, 9, 10, 11, 13, 14, 17, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90
Offset: 1

Views

Author

Emmanuel Amiot, Mar 19 2007

Keywords

Comments

The complement of A178751 (within integers > 1). - M. F. Hasler, Jun 06 2016

Examples

			19 is in the sequence because -1 == 10^9 (mod 19).
		

Crossrefs

Programs

  • Haskell
    a126949 n = a126949_list !! (n-1)
    a126949_list = filter h [1..] where
       h m = not $ null [(x, e) | x <- [2 .. m - 2], gcd x m == 1,
                                  e <- [2 .. a000010 m `div` 2],
                                  x ^ e `mod` m == m - 1]
    -- Reinhard Zumkeller, May 23 2013
    
  • Mathematica
    ord[x_, n_] := Module[{k = 1}, While[k <= EulerPhi[n]/2 && PowerMod[x, k, n] != n - 1, k++ ]; If[PowerMod[x, k, n] == n - 1, k, infinity]] iGeneralise[n_] := Module[{candidats = Range[n - 2]}, candidats = Select[candidats, (GCD[n, # ] == 1) &]; Select[candidats, (ord[ #, n] < n) &] ] sol = {}; Do[If[iGeneralise[n] != {}, AppendTo[sol, n]], {n, 2, 100}]
  • PARI
    is_A126949(n)={for(x=2,n-2, gcd(x,n)>1&&next; my(t=Mod(x,n)); while(abs(centerlift(t))>1,t*=x); t==-1&&return(x))} \\ (Based on code for A178751 by Ch. Greathouse.) - M. F. Hasler, Jun 07 2016

Extensions

Edited by M. F. Hasler, Jun 06 2016

A151925 Write n as a sum of positive squares a^2+b^2+c^2+... with gcd(a,b,...) = 1; a(n) = minimal number of squares needed.

Original entry on oeis.org

1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 2, 3, 4, 3, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 3, 3
Offset: 1

Views

Author

N. J. A. Sloane and Vinay Vaishampayan, Aug 06 2009, Aug 07 2009

Keywords

Comments

Similar to A002828, but only now primitive representations are allowed.
Of course a(n) >= A002828(n).
From Lagrange's theorem, a(n) <= 5 (see also Estermann, Grosswald, Th. 3, p. 176).
Furthermore, it appears (and should be easy to prove) that:
a(n) = 1 iff n=1
a(n) = 2 iff n in A008784\{1}
a(n) = 3 iff n in A151926
a(n) = 4 iff n == 4 or 7 mod 8
a(n) = 5 iff n == 0 mod 8

Examples

			..... n .. a(n) ..<- Numbers when squared add to n ->
-----------------------------------------------------
......1......1......1
......2......2......1......1
......3......3......1......1......1
......4......4......1......1......1......1
......5......2......1......2
......6......3......1......1......2
......7......4......1......1......1......2
......8......5......1......1......1......1......2
......9......3......1......2......2
.....10......2......1......3
.....11......3......1......1......3
.....12......4......1......1......1......3
.....13......2......2......3
.....14......3......1......2......3
.....15......4......1......1......2......3
.....16......5......1......1......1......2......3
.....17......2......1......4
.....18......3......1......1......4
.....19......3......1......3......3
.....20......4......1......1......3......3
		

References

  • Estermann, T., On the representations of a number as a sum of squares, Acta Arith., 45 (1937), 93-125.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985.

A281877 Numbers that are a primitive sum of two squares in more than 2 ways.

Original entry on oeis.org

1105, 1885, 2210, 2405, 2465, 2665, 3145, 3445, 3485, 3770, 3965, 4505, 4745, 4810, 4930, 5185, 5330, 5365, 5525, 5785, 5945, 6205, 6290, 6305, 6409, 6565, 6890, 6970, 7085, 7345, 7565, 7585, 7685, 7930, 8177, 8245, 8585, 8845, 8905, 9010, 9061, 9265, 9425, 9490, 9605, 9685, 9805
Offset: 1

Views

Author

R. J. Mathar, Feb 01 2017

Keywords

Comments

"Primitive" means that x and y are coprime in the representations x^2+y^2.

Crossrefs

Cf. A224450 (exactly 1 way), A224770 (exactly 2 ways), A008784, A097102.

Programs

  • Maple
    N:= 10^4: # to get all terms <= N
    V:= Vector(N):
    for a from 1 to floor(sqrt(N)) do
      for b from 1 to min(a, floor(sqrt(N-a^2))) do
        if igcd(a,b) > 1 then next fi;
        r:= a^2 + b^2;
        V[r]:= V[r]+1;
    od od:
    select(n -> V[n] > 2, [$1..N]); # Robert Israel, Feb 07 2017

A034024 Imprimitively but not primitively represented by x^2+y^2.

Original entry on oeis.org

4, 8, 9, 16, 18, 20, 32, 36, 40, 45, 49, 52, 64, 68, 72, 80, 81, 90, 98, 100, 104, 116, 117, 121, 128, 136, 144, 148, 153, 160, 162, 164, 180, 196, 200, 208, 212, 225, 232, 234, 242, 244, 245, 256, 260, 261, 272, 288, 292, 296, 306, 320, 324, 328
Offset: 0

Views

Author

Keywords

Crossrefs

Previous Showing 21-30 of 45 results. Next