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.

A005054 a(0) = 1; a(n) = 4*5^(n-1) for n >= 1.

Original entry on oeis.org

1, 4, 20, 100, 500, 2500, 12500, 62500, 312500, 1562500, 7812500, 39062500, 195312500, 976562500, 4882812500, 24414062500, 122070312500, 610351562500, 3051757812500, 15258789062500, 76293945312500, 381469726562500, 1907348632812500, 9536743164062500
Offset: 0

Views

Author

Keywords

Comments

Consider the sequence formed by the final n decimal digits of {2^k: k >= 0}. For n=1 this is 1, 2, 4, 8, 6, 2, 4, ... (A000689) with period 4. For any n this is periodic with period a(n). Cf. A000855 (n=2), A126605 (n=3, also n=4). - N. J. A. Sloane, Jul 08 2022
First differences of A000351.
Length of repeating cycle of the final n+1 digits in Fermat numbers. - Lekraj Beedassy, Robert G. Wilson v and Eric W. Weisstein, Jul 05 2004
Number of n-digit endings for a power of 2 whose exponent is greater than or equal to n. - J. Lowell
For n>=1, a(n) is equal to the number of functions f:{1,2,...,n}->{1,2,3,4,5} such that for a fixed x in {1,2,...,n} and a fixed y in {1,2,3,4,5} we have f(x) != y. - Aleksandar M. Janjic and Milan Janjic, Mar 27 2007
Equals INVERT transform of A033887: (1, 3, 13, 55, 233, ...) and INVERTi transform of A001653: (1, 5, 29, 169, 985, 5741, ...). - Gary W. Adamson, Jul 22 2010
a(n) = (n+1) terms in the sequence (1, 3, 4, 4, 4, ...) dot (n+1) terms in the sequence (1, 1, 4, 20, 100, ...). Example: a(4) = 500 = (1, 3, 4, 4, 4) dot (1, 1, 4, 20, 100) = (1 + 3 + 16, + 80 + 400), where (1, 3, 16, 80, 400, ...) = A055842, finite differences of A005054 terms. - Gary W. Adamson, Aug 03 2010
a(n) is the number of compositions of n when there are 4 types of each natural number. - Milan Janjic, Aug 13 2010
Apart from the first term, number of monic squarefree polynomials over F_5 of degree n. - Charles R Greathouse IV, Feb 07 2012
For positive integers that can be either of two colors (designated by ' or ''), a(n) is the number of compositions of 2n that are cardinal palindromes; that is, palindromes that only take into account the cardinality of the numbers and not their colors. Example: 3', 2'', 1', 1, 2', 3'' would count as a cardinal palindrome. - Gregory L. Simay, Mar 01 2020
a(n) is the length of the period of the sequence Fibonacci(k) (mod 5^(n-1)) (for n>1) and the length of the period of the sequence Lucas(k) (mod 5^n) (Kramer and Hoggatt, 1972). - Amiram Eldar, Feb 02 2022

References

  • T. Koshy, "The Ends Of A Fermat Number", pp. 183-4 Journal Recreational Mathematics, vol. 31(3) 2002-3 Baywood NY.

Crossrefs

Programs

  • Magma
    [(4*5^n+0^n)/5: n in [0..30]]; // Vincenzo Librandi, Jun 08 2013
    
  • Maple
    a:= n-> ceil(4*5^(n-1)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 08 2022
  • Mathematica
    CoefficientList[Series[(1 - x) / (1 - 5 x), {x, 0, 50}], x] (* Vincenzo Librandi, Jun 08 2013 *)
  • PARI
    Vec((1-x)/(1-5*x) + O(x^100)) \\ Altug Alkan, Dec 07 2015

Formula

a(n) = (4*5^n + 0^n) / 5. - R. J. Mathar, May 13 2008
G.f.: (1-x)/(1-5*x). - Philippe Deléham, Nov 02 2009
G.f.: 1/(1 - 4*Sum_{k>=1} x^k).
a(n) = 5*a(n-1) for n>=2. - Vincenzo Librandi, Dec 31 2010
a(n) = phi(5^n) = A000010(A000351(n)).
E.g.f.: (4*exp(5*x)+1)/5. - Paul Barry, Apr 20 2003
a(n + 1) = (((1 + sqrt(-19))/2)^n + ((1 - sqrt(-19))/2)^n)^2 - (((1 + sqrt(-19))/2)^n - ((1 - sqrt(-19))/2)^n)^2. - Raphie Frank, Dec 07 2015

Extensions

Better definition from R. J. Mathar, May 13 2008
Edited by N. J. A. Sloane, Jul 08 2022

A000689 Final decimal digit of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6
Offset: 0

Views

Author

Keywords

Comments

These are the analogs of the powers of 2 in carryless arithmetic mod 10.
Let G = {2,4,8,6}. Let o be defined as XoY = least significant digit in XY. Then (G,o) is an Abelian group wherein 2 is a generator (also see the first comment under A001148). - K.V.Iyer, Mar 12 2010
This is also the decimal expansion of 227/1818. - Kritsada Moomuang, Dec 21 2021

Examples

			G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 6*x^4 + 2*x^5 + 4*x^6 + 8*x^7 + 6*x^8 + ...
		

Crossrefs

Programs

  • Haskell
    a000689 n = a000689_list !! n
    a000689_list = 1 : cycle [2,4,8,6]  -- Reinhard Zumkeller, Sep 15 2011
  • Magma
    [2^n mod 10: n in [0..150]]; // Vincenzo Librandi, Apr 12 2011
    
  • Mathematica
    Table[PowerMod[2, n, 10], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
  • PARI
    for(n=0,80, if(n,{x=(n+3)%4+1; print1(10-(4*x^3+47*x-27*x^2)/3,", ")},{print1("1, ")}))
    
  • SageMath
    [power_mod(2,n,10)for n in range(0, 81)] # Zerinvary Lajos, Nov 03 2009
    

Formula

Periodic with period 4.
a(n) = 2^n mod 10.
a(n) = A002081(n) - A002081(n-1), for n > 0.
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3), n > 3.
G.f.: (x+3*x^2+5*x^3+1)/((1-x) * (1+x^2)). (End)
For n >= 1, a(n) = 10 - (4x^3 + 47x - 27x^2)/3, where x = (n+3) mod 4 + 1.
For n >= 1, a(n) = A070402(n) + 5*floor( ((n-1) mod 4)/2 ).
G.f.: 1 / (1 - 2*x / (1 + 5*x^3 / (1 + x / (1 - 3*x / (1 + 3*x))))). - Michael Somos, May 12 2012
a(n) = 5 + cos((n*Pi)/2) - 3*sin((n*Pi)/2) for n >= 1. - Kritsada Moomuang, Dec 21 2021

A126605 Final three digits of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 24, 48, 96, 192, 384, 768, 536, 72, 144, 288, 576, 152, 304, 608, 216, 432, 864, 728, 456, 912, 824, 648, 296, 592, 184, 368, 736, 472, 944, 888, 776, 552, 104, 208, 416, 832, 664, 328, 656, 312, 624, 248, 496, 992, 984, 968
Offset: 0

Views

Author

Zak Seidov, Mar 13 2007

Keywords

Comments

Has period 100. Sequence of last four digits has period 500. Cf. A000855 Final two digits of 2^n, has period 20.

Crossrefs

Programs

  • Magma
    [Modexp(2, n, 1000): n in [0..110]]; // Vincenzo Librandi, Aug 16 2016
  • Mathematica
    Table[PowerMod[2,n,1000],{n,0,1000}]
  • PARI
    for(i=0,103,print(i" "(2^i)%1000)) \\ V. Raman, Sep 01 2012
    

Formula

For n > 54: a(n) = a(n-1) - a(n-50) + a(n-51). - Ray Chandler, Aug 09 2025

A068994 Powers of 2 with all even digits.

Original entry on oeis.org

2, 4, 8, 64, 2048
Offset: 1

Views

Author

Joseph L. Pe, Mar 14 2002

Keywords

Comments

The corresponding exponents are: 1, 2, 3, 6, 11.
Are there any more terms in this sequence?
Evidence that the sequence may be finite, from Rick L. Shepherd, Jun 23 2002:
1) The sequence of last two digits of 2^n, A000855 of period 20, makes clear that 2^n > 4 must have n == 3, 6, 10, 11, or 19 (mod 20) for 2^n to be a member of this sequence. Otherwise, either the tens digit (in 10 cases), as seen directly, or the hundreds digit, in the 5 cases receiving a carry from the previous power's tens digit >= 5, must be odd.
2) No additional term has been found for n up to 50000.
3) Furthermore, again for each n up to 50000, examining 2^n's digits leftward from the rightmost but only until an odd digit was found, it was only once necessary to search even to the 18th digit. This occurred for 2^12106 whose last digits are ...3833483966860466862424064. Note that 2^12106 has 3645 digits. (The clear runner-up, 2^34966, a 10526-digit number, required searching only to the 15th digit. Exponents for which only the 14th digit was reached were only 590, 3490, 8426, 16223, 27771, 48966 and 49519 - representing each congruence above.)
No additional terms up to 2^100000. - Harvey P. Dale, Dec 25 2012
No additional terms up to 2^(10^10). - Michael S. Branicky, Apr 16 2023
No additional terms up to 2^(10^11). See C program in links. It was only necessary to check the rightmost 40 digits of each power. But for going towards 10^12, 40 digits won't suffice. - Lukas Huwald, Mar 20 2025
No additional terms up to 2^(10^13). See second C program in links. The champions in this range are 2^133477987019 with 46 even last digits and 2^9780164740006 with 45 even last digits. - Fredrik Johansson, Mar 21 2025
No additional terms up to 2^(10^17). See Go program in links which uses a strong sieve to accelerate the computation substantially. - Ted E Dunning, Mar 31 2025

Crossrefs

Cf. A000855 (final two digits of 2^n), A096549.

Programs

  • Mathematica
    (*returns true if none of digits of n are odd, false o.w.*) f[n_] := Module[{ a, l, r, i}, a = IntegerDigits[n]; l = Length[a]; r = True; For[i = 1, i <= l, i++, If[Mod[a[[i]], 2] == 1, r = False; Break[ ]]]; r] (*main routine*) Do[p = 2^i; If[f[p], Print[p]], {i, 1, 10^4}]
    Select[2^Range[0,100],Union[Take[DigitCount[#],{1,-1,2}]]=={0}&] (* Harvey P. Dale, Dec 25 2012 *)
    Select[2^Range[0,100],AllTrue[IntegerDigits[#],EvenQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 18 2016 *)
  • PARI
    f(n)=n=vecsort(eval(Vec(Str(n)))%2,,8);#v==1&&v[1]==0
    m=Mod(1,10^19);for(n=1,1e5,m*=2;if(f(lift(m))&&f(2^n),print1(2^n", "))) \\ Charles R Greathouse IV, Apr 09 2012

A060460 Consider the final n decimal digits of 2^j for all values of j. They are periodic. Sequence gives position (or phase) of the maximal value seen in these n digits.

Original entry on oeis.org

3, 12, 53, 254, 1255, 6256, 31257, 156258, 781259, 3906260, 19531261, 97656262, 488281263, 2441406264, 12207031265, 61035156266, 305175781267, 1525878906268, 7629394531269, 38146972656270, 190734863281271
Offset: 1

Views

Author

Labos Elemer, Apr 09 2001

Keywords

Comments

The last n digits of 2^a(n) are predictable if maximal values of periods are known.

Examples

			a(2) = 5*3-(3+4*0) = 15-3 = 12, etc...
For n=2, the last 2 digits of powers of 2 have the period {2,4,8,16,32,64,28,56,12,24,48,96,92,84,68,36,72,44,88,76,52,4,8,16,32} displayed in A000855. The maximum is 96 and it occurs at 2^12=4096. So a(2)=12.
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,5b-(3+4(n-1))}; NestList[nxt,{2,3,12},20][[All,2]] (* or *) Table[2*5^(n-1)+n,{n,30}] (* or *) LinearRecurrence[{7,-11,5},{3,12,53},30] (* Harvey P. Dale, Aug 01 2021 *)

Formula

a(1) = 3, a(n) = 5*a(n-1)-(3+4*(n-2)).
a(n) = a(n) = 2*5^(n-1) + n.
G.f.: (-3 + 9 x - 2 x^2)/((-1 + x)^2 (-1 + 5 x)) - Harvey P. Dale, Aug 01 2021

Extensions

Offset 1 (and formulas adapted) from Michel Marcus, Mar 25 2020

A181610 The last n digits of powers of 2 start cycling. a(n) is the number of zero-free terms in this cycle.

Original entry on oeis.org

4, 18, 81, 364, 1638, 7371, 33170, 149268, 671701, 3022653, 13601945, 61208743, 275439346, 1239477074, 5577646830, 25099410745, 112947348510, 508263067945, 2287183805359, 10292327123878, 46315472056678, 208419624257654, 937888309161430, 4220497391215744
Offset: 1

Views

Author

Tanya Khovanova, Jan 30 2011

Keywords

Examples

			The last two digits of powers of two cycle through 20 terms (A000855): 04, 08, 16, 32, 64, 28, 56, 12, 24, 48, 96, 92, 84, 68, 36, 72, 44, 88, 76, 52. Out of those 18 do not contain a zero. Hence a(2) = 18.
		

Crossrefs

The corresponding cycle length is A005054. See A126605 for n=3.

Programs

  • Mathematica
    f[n_] := Block[{c = 0, k = n, lmt = n + 4*5^(n - 1)},
    While[k < lmt, m = PowerMod[2, k, 10^n];
      If[m >= 10^(n - 1) && !MemberQ[ IntegerDigits@ m, 0], c++ ]; k++ ]; c];
    Array[ f, 11] (* Robert G. Wilson v, Jan 30 2011 *)

Extensions

a(8)-a(11) from Robert G. Wilson v, Jan 30 2011
a(12)-a(24) from Hiroaki Yamanouchi, Mar 21 2015

A216095 a(n) = 2^n mod 10000.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 6384, 2768, 5536, 1072, 2144, 4288, 8576, 7152, 4304, 8608, 7216, 4432, 8864, 7728, 5456, 912, 1824, 3648, 7296, 4592, 9184, 8368, 6736, 3472, 6944, 3888, 7776, 5552, 1104, 2208, 4416, 8832, 7664, 5328, 656, 1312, 2624, 5248, 496, 992, 1984, 3968, 7936, 5872, 1744, 3488, 6976, 3952, 7904, 5808
Offset: 0

Views

Author

V. Raman, Sep 01 2012

Keywords

Comments

Period = 500.

Crossrefs

Programs

  • Magma
    [Modexp(2, n, 10000): n in [0..110]]; // Vincenzo Librandi, Aug 16 2016
  • Mathematica
    PowerMod[2, Range[0, 100], 10000] (* Vincenzo Librandi, Aug 16 2016 *)
  • PARI
    for(i=0,500,print(2^i%10000" "))
    

Formula

For n > 255: a(n) = a(n-1) - a(n-250) + a(n-251). - Ray Chandler, Aug 09 2025

A247207 4^(2^n) + 3^(2^n) + 2^(2^n) + 1.

Original entry on oeis.org

10, 30, 354, 72354, 4338079554, 18448597098193370754, 340282370354622283774333836163326852354, 115792089237316207213755562747271079374483128445080168181132550891186006948354
Offset: 0

Views

Author

Alonso del Arte, Nov 25 2014

Keywords

Examples

			a(2) = 4^4 + 3^4 + 2^4 + 1 = 256 + 81 + 16 + 1 = 354.
a(3) = 4^8 + 3^8 + 2^8 + 1 = 65536 + 6561 + 256 + 1 = 72354.
		

Crossrefs

Programs

  • Mathematica
    Table[1 + Sum[k^(2^n), {k, 2, 4}], {n, 0, 7}]

Formula

a(n) = sum_{k = 1 .. 4} k^(2^n).
For all n > 1, a(n) = 54 mod 100.
Showing 1-8 of 8 results.