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

A257164 Period 5 sequence: repeat [0, 2, 4, 1, 3].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Apr 16 2015

Keywords

Comments

Label the vertices of a regular pentagon from 0..4 going clockwise. Then, starting at vertex "0", a(n) gives the order in which the vertices must be connected to draw a clockwise inscribed, 5-pointed star that remains unbroken during construction.

Examples

			0 -> 2 -> 4 -> 1 -> 3 -> ..repeat
		

Crossrefs

Cf. A005843.
Bisection of A010874.

Programs

  • Magma
    [(2*n mod 5) : n in [0..100]];
    
  • Maple
    A257164:=n->(2*n mod 5): seq(A257164(n), n=0..100);
  • Mathematica
    Mod[2 Range[0, 100], 5] (* or *)
    CoefficientList[Series[x (2 + 4 x + x^2 + 3 x^3)/(1 - x^5), {x, 0, 100}], x]
    LinearRecurrence[{0, 0, 0, 0, 1}, {0, 2, 4, 1, 3}, 105] (* or *)
    NestList[# /. {0 -> 2, 1 -> 3, 2 -> 4, 3 -> 0, 4 -> 1} &, {0}, 104] // Flatten (* Robert G. Wilson v, Apr 30 2015 *)
  • PARI
    a(n)=2*n%5 \\ Charles R Greathouse IV, Apr 21 2015

Formula

a(n) = (2n mod 5) = A010874(A005843(n)).
G.f.: x*(2+4*x+x^2+3*x^3)/(1-x^5).
Recurrence: a(n) = a(n-5).
a(n) = a(a(a(a(a(n))))).
a(-n) = A010874(3n) = a(a(a(n))).
Bisections: a(2n) = A010874(-n) = a(a(n)); a(2n+1) = A010874(2-n).
Trisections: a(3n) = A010874(n) = a(a(a(a(n)))); a(3n+1) = A010874(n+2); a(3n+2) = A010874(n-1).

A308776 Counterclockwise square spiral of distinct positive integers constructed by greedy algorithm, such that for k = 1..5, every term equal to k mod 5 (except k itself) is vertically or horizontally adjacent to a cell already holding a value equal to k mod 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 11, 16, 7, 12, 17, 8, 13, 18, 9, 10, 15, 20, 21, 26, 31, 36, 41, 22, 27, 32, 37, 42, 23, 28, 33, 38, 43, 14, 19, 24, 29, 25, 30, 35, 40, 45, 50, 46, 51, 56, 47, 52, 57, 62, 67, 72, 77, 48, 53, 58, 63, 68, 73, 78, 34, 39, 44, 49, 54, 59, 55
Offset: 1

Views

Author

Rémy Sigrist, Jun 24 2019

Keywords

Comments

For k = 1..5, let M_k be the set of lattice points with a value equal to k mod 5; the sets M_1, ..., M_5 form 5 arms that spiral around the origin (see representation in Links section). As a consequence, the sequence alternates runs of terms in arithmetic progression with first difference 5.
This sequence appears to be a permutation of the natural numbers.
This sequence has similarities with A308505.

Examples

			The spiral begins:
   89---84---79---74---69---64--123--118--113--108--103
    |                                                 |
   94   54---49---44---39---34---78---73---68---63   98
    |    |                                       |    |
   99   59   29---24---19---14---43---38---33   58   93
    |    |    |                             |    |    |
   95   55   25   15---10----9---18---13   28   53   88
    |    |    |    |                   |    |    |    |
  100   60   30   20    5----4----3    8   23   48   83
    |    |    |    |    |         |    |    |    |    |
  105   65   35   21    6    1----2   17   42   77  112
    |    |    |    |    |              |    |    |    |
  110   70   40   26   11---16----7---12   37   72  107
    |    |    |    |                        |    |    |
  115   75   45   31---36---41---22---27---32   67  102
    |    |    |                                  |    |
  120   80   50---46---51---56---47---52---57---62   97
    |    |                                            |
  125   85---90---61---66---71---76---81---82---87---92
    |
  130--135--140---86---91---96--101--106--111--116--117
		

Crossrefs

Programs

  • PARI
    See Links section.

A372808 a(n) = sum of the digits (mod 5) of 5^n.

Original entry on oeis.org

1, 0, 2, 3, 3, 6, 4, 8, 10, 11, 10, 18, 18, 13, 9, 14, 18, 26, 24, 29, 26, 27, 27, 29, 32, 37, 34, 34, 40, 38, 36, 39, 46, 49, 38, 47, 39, 49, 44, 54, 60, 57, 60, 64, 66, 71, 52, 48, 55, 63, 71, 67, 70, 59, 52, 52, 71, 85, 96, 96, 84, 89, 87, 85, 76, 74, 71, 80
Offset: 0

Views

Author

Paolo Xausa, May 13 2024

Keywords

Examples

			a(7) = 8 since 5^7 = 78125 and (7 mod 5) + (8 mod 5) + (1 mod 5) + (2 mod 5) + (5 mod 5) = 2 + 3 + 1 + 2 + 0 = 8.
		

Crossrefs

Programs

  • Mathematica
    Array[Total[Mod[IntegerDigits[5^#], 5]] &, 100, 0]
  • PARI
    a(n) = my(d=digits(5^n)); vecsum(apply(x->(x % 5), d)); \\ Michel Marcus, May 17 2024

Formula

Sum_{n >= 1} a(n)/5^n = 1/9. See Example 5.1 (e) in Borwein and Borwein (1992), p. 639.

A374015 Residue modulo 5 of n! divided by the highest power of 10 which divides n!.

Original entry on oeis.org

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

Views

Author

Cezary Glowacz, Jun 25 2024

Keywords

Comments

The sequence is not eventually periodic. This because by induction on k the eventual period must be a multiple of 5^k for every k.
a(5^k) = 2^k mod 5.
From Cezary Glowacz, Feb 07 2025: (Start)
The proportions p(m,s) of counts of pairs of consecutive terms s among a(1),...,a(m) converge to equidistribution (and as an immediate consequence, so do proportions of individual terms).
This can be seen, for example, by stating p(5^(4(n+1)+1)-1,s) as affine functions of p(5^(4n+1)-1,t) and examining the convergence of p(5^(4n+1)-1,u) to the equidistribution. Then, p(m,s) converges to the equidistribution because the maximum over s of the absolute values of deviations from 1/16 of p(m,s) for m>k*5^(4n+1)-1 is less than the corresponding maximum over t for p(5^(4n+1)-1,t) plus 2/(5^(4n+1)) + 1/k.
Consecutive terms 1,2,3 do not occur, so that triples do not have a similar equidistribution.
(End)
If n > 0 is not divisible by 5, a(n) == n * a(n-1) (mod 5). - Robert Israel, Jul 05 2024

Examples

			a(5) = 1*2*3*4*5/10 mod 5 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (f-> irem(f/10^padic[ordp](f, 10), 5))(n!):
    seq(a(n), n=0..105);  # Alois P. Heinz, Jun 25 2024
  • Mathematica
    a[n_]:=Mod[n!/10^IntegerExponent[n!, 10],5]; Array[a,106,0] (* Stefano Spezia, Jun 25 2024 *)
  • PARI
    a(n)=if(n>4, my(k=n\5); return(lift((n%5)!*a(k)*Mod(2,5)^k))); n!%5 \\ Charles R Greathouse IV, Jan 24 2025
  • Python
    v=[[((1,1,2,1,4)[j]*2**(i*j))%5 for j in range(5)] for i in range(4)]
    def a(n):
        c,p=0,1
        while n: c,n,p=(c+1)%4,n//5,(v[c][n%5]*p)%5
        return(p) # Cezary Glowacz, Feb 05 2025
    

Formula

a(n) = A010874(A004154(n)).

A126045 Exponents p of the Mersenne primes 2^p - 1 (see A000043) read mod 5.

Original entry on oeis.org

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

Views

Author

Artur Jasinski, Dec 17 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Mod[MersennePrimeExponent@ #, 5] &, 45] (* Michael De Vlieger, Apr 07 2018 *)

Formula

a(n) = A010874(A000043(n)). - Michel Marcus, Apr 07 2018

Extensions

a(45)-a(47) from Ivan Panchenko, Apr 08 2018
a(48) from Amiram Eldar, Oct 14 2024

A137936 a(n) = 5*mod(n,5) + floor(n/5).

Original entry on oeis.org

0, 5, 10, 15, 20, 1, 6, 11, 16, 21, 2, 7, 12, 17, 22, 3, 8, 13, 18, 23, 4, 9, 14, 19, 24, 5, 10, 15, 20, 25, 6, 11, 16, 21, 26, 7, 12, 17, 22, 27, 8, 13, 18, 23, 28, 9, 14, 19, 24, 29, 10, 15, 20, 25, 30, 11, 16, 21, 26, 31, 12, 17, 22, 27, 32, 13, 18, 23, 28, 33, 14, 19, 24, 29, 34
Offset: 0

Views

Author

William A. Tedeschi, Mar 06 2008

Keywords

Examples

			a(0) = 5*mod(0,5) + floor(0/5) = 0
a(3) = 5*mod(3,5) + floor(3/5) = 15
		

Crossrefs

Programs

  • Python
    a = lambda n: 5*(n%5) + floor(n/5)

Formula

a(n) = 5*mod(n,5) + floor(n/5) = 5*A010874(n) + A002266(n)
O.g.f.: -x(-5x^3+19x^4-5x^2-5x-5)/[(-1+x)^2*(x^3+x^4+x^2+x+1)] . - R. J. Mathar, Mar 07 2008

A358012 Minimal number of coins needed to pay n cents using coins of denominations 1 and 5 cents.

Original entry on oeis.org

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

Views

Author

Sandra Snan, Oct 24 2022

Keywords

Comments

Sequence consists of runs of five consecutive integers: 0..4, 1..5, 2..6, 3..7, etc.

Crossrefs

Cf. A076314 (1,10 cents), A053344 (1,5,10,25 cents).

Programs

Formula

Sum of quotient and remainder of n/5.
a(n) = A002266(n) + A010874(n).
Previous Showing 51-57 of 57 results.