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-10 of 14 results. Next

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

A000855 Final two digits of 2^n.

Original entry on oeis.org

1, 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, 64, 28, 56, 12, 24, 48, 96, 92, 84, 68, 36, 72, 44, 88, 76, 52, 4, 8, 16, 32, 64, 28, 56, 12, 24, 48, 96, 92, 84, 68, 36, 72, 44, 88, 76, 52, 4, 8, 16, 32, 64, 28
Offset: 0

Views

Author

Keywords

Comments

Has period 20 (starting with a(2)=4).

Crossrefs

Programs

Formula

G.f.: -(50*x^12 +25*x^11 +13*x^10 -44*x^9 +28*x^8 -36*x^7 +32*x^6 +16*x^5 +8*x^4 +4*x^3 +2*x^2 +x +1) / ((x -1)*(x^2 +1)*(x^8 -x^6 +x^4 -x^2 +1)). - Colin Barker, Dec 01 2014
For n > 13: a(n) = a(n-1) - a(n-10) + a(n-11). - Ray Chandler, Aug 09 2025

A070402 a(n) = 2^n mod 5.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Periodic with period 4: [1, 2, 4, 3]. - Washington Bomfim, Nov 23 2010

Crossrefs

Cf. A173635.

Programs

  • GAP
    List([0..83],n->PowerMod(2,n,5)); # Muniru A Asiru, Feb 01 2019
  • Magma
    [Modexp(2, n, 5): n in [0..100]]; // Bruno Berselli, Mar 23 2016
    
  • Maple
    A070402 := proc(n) op((n mod 4)+1,[1,2,4,3]) ; end proc: # R. J. Mathar, Feb 05 2011
  • Mathematica
    PadRight[{}, 100, {1, 2, 4, 3}] (* or *) CoefficientList[Series[(1 + 2 x + 4 x^2 + 3 x^3) / (1 - x^4), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 25 2016 *)
    PowerMod[2,Range[0,120],5] (* Harvey P. Dale, Sep 16 2020 *)
  • PARI
    for(n=0, 80, x=n%4; print1(1 + (15*x^2 -5*x -4*x^3)/6, ", ")) \\ Washington Bomfim, Nov 23 2010
    
  • Sage
    [power_mod(2,n,5) for n in range(0, 105)] # Zerinvary Lajos, Jun 08 2009
    

Formula

From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3).
G.f.: (1 + x + 3*x^2) / ((1-x)*(1+x^2)). (End)
From Washington Bomfim, Nov 23 2010: (Start)
a(n) = 1 + (15*r^2 - 5*r - 4*r^3)/6, where r = n mod 4.
a(n) = A000689(n) - 5*floor(((n-1) mod 4)/2) for n>0. (End)
E.g.f.: (1/2)*(5*exp(x) - 3*cos(x) - sin(x)). - G. C. Greubel, Mar 19 2016

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

A002081 Numbers congruent to {2, 4, 8, 16} (mod 20).

Original entry on oeis.org

2, 4, 8, 16, 22, 24, 28, 36, 42, 44, 48, 56, 62, 64, 68, 76, 82, 84, 88, 96, 102, 104, 108, 116, 122, 124, 128, 136, 142, 144, 148, 156, 162, 164, 168, 176, 182, 184, 188, 196, 202, 204, 208, 216, 222, 224, 228, 236, 242, 244, 248, 256, 262, 264, 268, 276, 282
Offset: 0

Views

Author

Keywords

Comments

First differences are periodic, cf. A000689.

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

Programs

  • Haskell
    a002081 n = a002081_list
    a002081_list = filter ((`elem` [2,4,8,16]) . (`mod` 20)) [1..]
    -- Reinhard Zumkeller, Sep 15 2011
  • Maple
    A002081:=2*(1+2*z**2+2*z**3)/(z**2+1)/(z-1)**2; # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Flatten[Table[20n + {2, 4, 8, 16}, {n, 0, 14}]] (* Alonso del Arte, Nov 30 2011 *)
    LinearRecurrence[{2, -2, 2, -1},{2, 4, 8, 16},57] (* Ray Chandler, Aug 25 2015 *)
    Select[Range[300],MemberQ[{2,4,8,16},Mod[#,20]]&] (* Harvey P. Dale, Jul 20 2021 *)
  • PARI
    a(n) = 5*n + [2,-1,-2,1][(n%4)+1] \\ Ralf Stephan, Jun 08 2005
    
  • PARI
    is(n) = n > 0 && setsearch([2,4,8,16], n%20) > 0 \\ Rick L. Shepherd, Aug 17 2016
    

Formula

G.f.: 2*(1+2*x^2+2*x^3)/((1-x)^2*(1+x^2)). - Simon Plouffe
a(n+4) = a(n) + 20 for n > 3. - Reinhard Zumkeller, Sep 15 2011
a(n) = 5*n + (1/2)*(3 + (-1)^n)*(-1)^(n(n+1)/2). - Bruno Berselli, Sep 15 2011
E.g.f.: 2*cos(x) - sin(x) + 5*x*exp(x). - Ilya Gutkovskiy, Aug 17 2016

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 31 2000

A160590 Next-to-least significant digit of 2^n.

Original entry on oeis.org

1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, 6, 3, 7, 4, 8, 7, 5, 0, 0, 1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, 6, 3, 7, 4, 8, 7, 5, 0, 0, 1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, 6, 3, 7, 4, 8, 7, 5, 0, 0, 1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, 6, 3, 7, 4, 8, 7, 5, 0, 0, 1, 3, 6, 2, 5, 1, 2, 4, 9, 9, 8, 6, 3, 7, 4, 8, 7, 5, 0, 0, 1, 3, 6, 2, 5
Offset: 4

Views

Author

Brian Tristam Williams (briantw(AT)briantw.com), May 20 2009

Keywords

Comments

In the sequence [1, 2, 4, 8,] 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, (A000079) the least-significant digit recurs as [..], 6,2,4,8.. (A000689).
The second-least-significant digit repeats in the sequence [..],1,3,6,2,5,1,2,4,9,9,8,6,3,7,4,8,7,5,0,0...

Crossrefs

Programs

  • Maple
    for n from 4 to 130 do 2 &^ n mod 100 ; printf("%d,", floor(%/10)) ; od:
  • Mathematica
    PadRight[{},100,{1,3,6,2,5,1,2,4,9,9,8,6,3,7,4,8,7,5,0,0}] (* Paolo Xausa, Oct 22 2023 *)

Formula

Periodic: a(n+20) = a(n).

Extensions

Edited by R. J. Mathar, May 22 2009

A367361 Comma transform of powers of 2.

Original entry on oeis.org

12, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 22, 45, 81, 62, 24, 49, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 23, 46, 81
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Partition[Rest@ Flatten[{First[#], Last[#]} & /@ IntegerDigits[2^Range[0, 120]]], 2, 2] (* Michael De Vlieger, Nov 22 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(2**i) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367361(n): return (60,20,40,80)[n&3]+int(str(1<Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A000689(n) + A008952(n+1). - Alois P. Heinz, Nov 22 2023

A220755 Numbers n such that n^2 + n(n+1)/2 is an oblong number (A002378).

Original entry on oeis.org

0, 1, 28, 117, 2760, 11481, 270468, 1125037, 26503120, 110242161, 2597035308, 10802606757, 254482957080, 1058545220041, 24936732758548, 103726628957277, 2443545327380640, 10164151092593121, 239442505350544188, 995983080445168597, 23462921979025949800
Offset: 1

Views

Author

Alex Ratushnyak, Apr 13 2013

Keywords

Comments

Numbers n such that 6*n^2 + 2*n + 1 is a square. - Joerg Arndt, Apr 14 2013
a(n+4) - a(n) is divisible by 40. (a(n+2) - a(n)) mod 10 = period 4: repeat 8, 6, 2, 4. See A000689. - Paul Curtz, Apr 15 2013
For this 5 consecutive terms recurrence,the main (or principal) sequence is: CRR(n)= 0, 0, 0, 0, 1, 1, 99, 99, 9702, 9702,... . - Paul Curtz, Apr 16 2013
Also numbers n such that the sum of the octagonal numbers N(n) and N(n+1) is equal to the sum of two consecutive triangular numbers. - Colin Barker, Dec 09 2014

Crossrefs

Cf. A000217, A005449 (n^2 + n(n+1)/2).
Cf. A011916 (numbers n>=0 such that n^2 + n(n+1)/2 is a triangular number).
Cf. A220186 (numbers n>=0 such that n^2 + n(n+1)/2 is a square).
Cf. A220185 (numbers n>=0 such that n^2 + n(n+1) is an oblong number).
(Example of a family of main sequences: A131577, A024495, A000749, A139761. )
Cf. A251793.

Programs

  • C
    #include 
    typedef unsigned long long U64;
    U64 rootPronic(U64 a) {
        U64 sr = 1L<<31, s, b;
        while (a < sr*(sr+1))  sr>>=1;
        for (b = sr>>1; b; b>>=1) {
                s = sr+b;
                if (a >= s*(s+1))  sr = s;
        }
        return sr;
    }
    int main() {
      U64 a, n, r, t;
      for (n=0; n < 3L<<30; n++) {
        a = n*(n+1)/2 + n*n;
        t = rootPronic(a);
        if (a == t*(t+1)) {
            printf("%llu\n", n);
        }
      }
    }
    
  • Mathematica
    LinearRecurrence[{1, 98, -98, -1, 1}, {0, 1, 28, 117, 2760}, 30] (* Giovanni Resta, Apr 14 2013 *)
    CoefficientList[Series[x (1 + 27 x - 9 x^2 - 3 x^3)/((1 - x) (1 - 10 x + x^2) (1 + 10 x + x^2)), {x, 0, 30}], x] (* Vincenzo Librandi, Aug 13 2014 *)
  • Maxima
    makelist(expand(((-(-1)^n+sqrt(6))*(5+2*sqrt(6))^(n-1)-((-1)^n+sqrt(6))*(5-2*sqrt(6))^(n-1)-2)/12), n, 1, 25); /* Bruno Berselli, Apr 14 2013 */
  • PARI
    concat([0], Vec( x * (1+27*x-9*x^2-3*x^3) / ( (1-x)*(1-10*x+x^2)*(1+10*x+x^2) ) + O(x^66) ) )  /* Joerg Arndt, Apr 14 2013 */
    

Formula

G.f.: x^2 * (1+27*x-9*x^2-3*x^3) / ( (1-x)*(1-10*x+x^2)*(1+10*x+x^2) ). - Giovanni Resta, Apr 14 2013, adapted by Vincenzo Librandi Aug 13 2014
a(n) = ((-(-1)^n+sqrt(6))*(5+2*sqrt(6))^(n-1)-((-1)^n+sqrt(6))*(5-2*sqrt(6))^(n-1)-2)/12. - Bruno Berselli, Apr 14 2013
a(n) = a(n-1) + 98*a(n-2) - 98*a(n-3) - a(n-4) + a(n-5).

Extensions

a(11)-a(21) from Giovanni Resta, Apr 14 2013

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

A267317 a(n) = final digit of 2^n-1.

Original entry on oeis.org

0, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 13 2016

Keywords

Comments

Decimal expansion of 25/1818.
Period 4: repeat [1, 3, 7, 5] for n > 0.

Crossrefs

Programs

  • Magma
    [0] cat &cat[[1, 3, 7, 5]^^25]; // Bruno Berselli, Jan 13 2016
    
  • Maple
    A267317:=n->(2^n-1) mod 10: seq(A267317(n), n=0..150); # Wesley Ivan Hurt, Jun 15 2016
  • Mathematica
    Table[Mod[2^n - 1, 10], {n, 0, 120}]
  • PARI
    a(n) = if(n==0, 0, if(n%4==0, 5, if(n%4==1, 1, if(n%4==2, 3, if(n%4==3, 7))))) \\ Felix Fröhlich, Jan 19 2016
    
  • PARI
    a(n) = lift(Mod(2^n-1, 10)) \\ Felix Fröhlich, Jan 19 2016

Formula

G.f.: x*(1 + 2*x + 5*x^2)/(1 - x + x^2 - x^3).
a(n) = A010879(A000225(n)).
a(n) = A000689(n) - 1.
a(n) = (1+(-1)^n)*(-1)^(n*(n-1)/2)/2 + 3*(1-(-1)^n)*(-1)^(n*(n+1)/2)/2 + 4 for n > 0, a(0) = 0. [Bruno Berselli, Jan 13 2016]
From Wesley Ivan Hurt, Jun 15 2016: (Start)
a(n) = a(n-4) for n>4.
a(2k+2) = A010703(k), a(2k+1) = A010688(k). (End)
From Wesley Ivan Hurt, Jul 06 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n > 3.
a(n) = 4 + cos(n*Pi/2) - 3*sin(n*Pi/2) for n > 0. (End)
E.g.f.: -5 + cos(x) - 3*sin(x) + 4*exp(x). - Ilya Gutkovskiy, Jul 06 2016
Showing 1-10 of 14 results. Next