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

A010461 Squares mod 100.

Original entry on oeis.org

0, 1, 4, 9, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 64, 69, 76, 81, 84, 89, 96
Offset: 1

Views

Author

Keywords

Comments

Range of A002015; subset of A122986. - Reinhard Zumkeller, Mar 21 2010

Crossrefs

Row 100 of A096008.
Cf. A028813.

Programs

  • Magma
    [n: n in [0..99] | IsSquare(R! n) where R:= ResidueClassRing(100)]; // Vincenzo Librandi, Dec 28 2019
  • Mathematica
    Union[PowerMod[Range[100], 2, 100]] (* Alonso del Arte, Dec 25 2019 *)
  • PARI
    A010461=Set(vector(100,n,n^2)%100) \\ M. F. Hasler, Mar 03 2014
    
  • Sage
    [quadratic_residues(100)] # Zerinvary Lajos, May 28 2009
    
  • Scala
    (1 to 100).map(n => (n * n) % 100).toSet.toSeq.sorted // Alonso del Arte, Dec 25 2019
    

A000993 Number of distinct quadratic residues mod 10^n; also number of distinct n-digit endings of base-10 squares.

Original entry on oeis.org

1, 6, 22, 159, 1044, 9121, 78132, 748719, 7161484, 70800861, 699869892, 6978353179, 69580078524, 695292156201, 6947835288052, 69465637212039, 694529215501164, 6944974263529141, 69446563720728612, 694457689921141299, 6944497426351013404
Offset: 0

Views

Author

Keywords

Examples

			Any square ends with one of 0, 1, 4, 5, 6, 9, so a(1) = 6.
A square may end with 22 different two-digit combinations: 00, 01, 04, 09, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 64, 69, 76, 81, 84, 89, 96. E.g., no number ending with 14 can be square, etc. See also A075821, A075823.
The finite sequence A122986 has a(3) = 159 terms. - _Reinhard Zumkeller_, Mar 21 2010
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover Publ., 2nd Ed., NY, 1966, Chapter XV, 'On The Square', p. 139.
  • 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

Programs

  • Magma
    [1] cat [(83 + 27*(-1)^n + 9*2^(1 + n) + (-1)^n*2^(2 + n) + 9*5^(2 + n) + (-1)^n*5^(2 + n) + 2^(1 + n)*5^(2 + n))/ 72: n in [0..20]]; // Vincenzo Librandi, Mar 29 2012
    
  • Maple
    -(-6+38*z+241*z^2-594*z^3-1285*z^4+1600*z^5+1500*z^6)/((-1+z)*(5*z-1)*(2*z+1)*(2*z-1)*(5*z+1)*(10*z-1)*(z+1)); #  Bruno Salvy
  • Mathematica
    a[n_] := (83 - 27*(-1)^n + 9*2^(n) - (-1)^n*2^(1 + n) + 9*5^(1 + n) - (-1)^n*5^(1 + n) + 2^(n)*5^(1 + n))/72; Table[ Floor[ a[n]], {n, 0, 20}]
    (* Or *) a[0] = 1; a[1] = 6; a[2] = 22; a[3] = 159; a[4] = 1044; a[5] = 9121; a[6] = 78132; a[7] = 748719; a[8] = 7161484; a[n_] := 130 a[n - 2] - 3129 a[n - 4] + 13000 a[n - 6] - 10000 a[n - 8]; Table[ a[n], {n, 0, 20}]
    (* Or *) CoefficientList[ Series[(1 - 4*x - 68*x^2 + 59*x^3 + 723*x^4 - 5*x^5 - 1700*x^6 - 500*x^7)/(1 - 10*x - 30*x^2 + 300*x^3 + 129*x^4 - 1290*x^5 - 100*x^6 + 1000*x^7), {x, 0, 20}], x] (* Robert G. Wilson v, Nov 27 2004 *)
    LinearRecurrence[{10,30,-300,-129,1290,100,-1000},{1,6,22,159,1044,9121,78132,748719},20] (* Harvey P. Dale, Dec 17 2017 *)
  • Python
    print([(2 + 2**n // 6) * (1 + 5**(n+1) // 12) if n else 1 for n in range(21)]) # Nick Hobson, Mar 10 2024

Formula

a(n) = floor( (83 - (-1)^n*(27 + 2^(n+1) + 5^(n+1)) + 9*2^n + (9 + 2^n)*5^(n+1)) / 72 ).
a(n+8) = 130 a(n+6) - 3129 a(n+4) + 13000 a(n+2) - 10000 a(n) for n >= 1.
G.f.: (1 - 4*x - 68*x^2 + 59*x^3 + 723*x^4 - 5*x^5 - 1700*x^6 - 500*x^7)/(1 - 10*x - 30*x^2 + 300*x^3 + 129*x^4 - 1290*x^5 - 100*x^6 + 1000*x^7).

A174452 a(n) = n^2 mod 1000.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 24, 89, 156, 225, 296, 369, 444, 521, 600, 681, 764, 849, 936, 25, 116, 209, 304, 401, 500, 601, 704, 809, 916, 25
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 21 2010

Keywords

Comments

a(n) = A000290(n) for n < 32, but a(32) = 24;
A008959(n) = a(n) mod 10; A002015(n) = a(n) mod 100;
periodic with period 500: a(n+500)=a(n) and a(250*n+k)=a(250*n-k) for k <= 250*n;
a(n) = (n mod 1000)^2 mod 1000;
a(m*n) = a(m)*a(n) mod 1000;
A122986 gives the range of this sequence;
a(n) = n for n = 0, 1, and 376.

Examples

			Some calculations for n=982451653, to be realized by hand:
a(n) = (53^2 + 200*6*3) mod 1000 = 6409 mod 1000 = 409;
a(n) = (653^2) mod 1000 = 426409 mod 1000 = 409;
a(n) = a(n mod 500) = a(153) = 409;
a(n) = 965211250482432409 mod 1000 = 409.
		

Crossrefs

Programs

Formula

a(n) = ((n mod 100)^2 + 200 * (floor(n/100) mod 10) * (n mod 10)) mod 1000.

A238712 Numbers in which squares may end (in base 10).

Original entry on oeis.org

0, 1, 4, 5, 6, 9, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 64, 69, 76, 81, 84, 89, 96, 100, 104, 116, 121, 124, 129, 136, 144, 156, 161, 164, 169, 176, 184, 196, 201, 204, 209, 216, 224, 225, 236, 241, 244, 249, 256, 264, 276, 281, 284, 289, 296, 304
Offset: 1

Views

Author

M. F. Hasler, Mar 03 2014

Keywords

Comments

The union of "squares mod 10" (= the first 6 terms) and "squares mod 100" (A010461) and "squares mod 1000" (A122986) etc.
The number of terms < 10^k beginning with k=0: 1, 6, 24, 165, 1101, 9306, 79620, 753462, 7198791, 70919559, ... - Robert G. Wilson v, Sep 04 2014

Examples

			6 is in the sequence because 4^2 = 16 ends in the digit 6.
7 is not in the sequence because no square can end with the digit 7.
		

Crossrefs

Cf. A161355, A246422, A246448 (Complement).

Programs

  • Mathematica
    mx = 3; t = Union@ Table[ Mod[n^2, 10^mx], {n, 10^mx/2}]; t = Union@ Flatten@ Table[ Mod[t, 10^m], {m, mx}] (* Robert G. Wilson v, Sep 04 2014 *)
  • PARI
    a=[];for(m=1,3,a=setunion(a,Set(vector(10^m,n,n^2)%10^m)));a

Formula

If n is present so is n^2. - Robert G. Wilson v, Sep 04 2014

A036688 Number of distinct n-digit suffixes of base-10 squares not containing the digit 0.

Original entry on oeis.org

5, 18, 119, 698, 5449, 41735, 359207, 3085197, 27434602, 243921771, 2188569304, 19636586858
Offset: 1

Views

Author

Keywords

Examples

			Any square ends with one of [ 0 ], 1, 4, 5, 6, 9, so a(1) = 5.
a(3) = A000993(3) - a(2) - #{100, 104, 201, 204, 209, 304, 400, 401, 404, 409, 500, 504, 600, 601, 604, 609, 704, 801, 804, 809, 900, 904} = 159 - 18 - 22 = 119, cf. A122986. - _Reinhard Zumkeller_, Mar 21 2010
		

Crossrefs

Cf. A036788.

Programs

Extensions

Explanation and more terms from David W. Wilson
a(11)-a(12) from Bert Dobbelaere, Mar 10 2021

A122987 Possible last three digits of n^3 (leading zeros omitted).

Original entry on oeis.org

0, 1, 3, 7, 8, 9, 11, 13, 16, 17, 19, 21, 23, 24, 27, 29, 31, 32, 33, 37, 39, 41, 43, 47, 48, 49, 51, 53, 56, 57, 59, 61, 63, 64, 67, 69, 71, 72, 73, 77, 79, 81, 83, 87, 88, 89, 91, 93, 96, 97, 99, 101, 103, 104, 107, 109, 111, 112, 113, 117, 119
Offset: 1

Views

Author

Sergio Pimentel, Sep 22 2006

Keywords

Comments

This is a finite sequence. a(505) = 999 is the last term.

Examples

			The last three digits of n^3 can be 111, 112, 113, etc. but not 114, 115, 116, etc.
		

Crossrefs

Programs

  • Maple
    s:={}: for n from 0 to 999 do s:=s union {n^3 mod 1000}: od: op(s); # Nathaniel Johnston, Jun 22 2011
  • Mathematica
    Union[Mod[Range[1000]^3,1000]] (* James C. McMahon, Nov 14 2024 *)

A122988 Number of possible arrangements of the last three digits of x^n for all x>0 (leading zeros omitted).

Original entry on oeis.org

1, 1000, 159, 505, 52, 105, 102, 505, 52, 505, 22, 505, 52, 505, 102, 105, 52, 505, 102, 505, 12, 505, 102, 505, 52, 25, 102, 505, 52, 505, 22, 505, 52, 505, 102, 105, 52, 505, 102, 505, 12, 505, 102, 505, 52, 105, 102, 505, 52, 505, 6, 505, 52, 505, 102, 105, 52
Offset: 0

Views

Author

Sergio Pimentel, Sep 22 2006

Keywords

Comments

Only possible values are {1, 4, 6, 12, 22, 25, 52, 102, 105, 159, 505, 1000}. - Robert G. Wilson v, Sep 27 2006.

Examples

			a(0) = 1 because the last three digits of x^0 are always 001 (just one possibility).
a(100)=4 because the last three digits of x^100 can be 000, 001, 376 or 625 (which is four possibilities).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ Union@ PowerMod[ Range@1000, n, 1000]; Table[ f@n, {n, 0, 56}] (* Robert G. Wilson v *)

Formula

a(n)=1 for n=0 only,
a(n)=4 for n=100*k, k>=1,
a(n)=6 for n=100*k-50, k>=1,
a(n)=12 for n=20*k, k>=1 except if k == 0 (mod 5),
a(n)=22 for n=20*k-10, k>=1 except if k == 3 (mod 5),
a(n)=25 for n=50*k-25, k>=1,
a(n)=52 for n=4*k, k>=1 except if k == 0 (mod 5),
a(n)=102 for n=4*k-2, k>=2 except if k == 3 (mod 5),
a(n)=105 for n=10*k-5, k>=1 except if k == 3 (mod 5),
a(n)=159 for n=2 only,
a(n)=505 for n=2*k-1, k>=2 except if k == 3 (mod 5) and
a(n)=1000 for n=1 only.

Extensions

Edited and extended by Robert G. Wilson v, Sep 27 2006

A187126 Triangular numbers k*(k+1)/2 mod 1000, sorted and uniqued.

Original entry on oeis.org

0, 1, 3, 5, 6, 10, 11, 15, 16, 20, 21, 25, 26, 28, 30, 31, 35, 36, 40, 41, 45, 46, 50, 51, 55, 56, 60, 61, 65, 66, 70, 71, 75, 76, 78, 80, 81, 85, 86, 90, 91, 95, 96, 100, 101, 105, 106, 110, 111, 115, 116, 120, 121, 125, 126, 128, 130, 131, 135, 136, 140
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 30 2013

Keywords

Comments

Possible last three digits of triangular numbers k*(k+1)/2 (leading zeros omitted).
All triangular numbers less than 1000 belong to this sequence. The sequence is finite with 424 terms: a(424)=996 is the last term.

Examples

			The last three digits of k*(k+1)/2 can be 000, 001, 003, 021, 140, etc., but not 002, 004, 012, 139 etc.
		

Crossrefs

Programs

  • Mathematica
    Union[Table[Mod[n*(n + 1)/2, 1000], {n, 1, 1000}]]
Showing 1-8 of 8 results.