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

A245357 Number of numbers whose base 5/4 expansion (see A024634) has n digits.

Original entry on oeis.org

5, 5, 5, 5, 5, 10, 10, 15, 15, 20, 25, 30, 40, 50, 60, 75, 95, 120, 150, 185, 235, 290, 365, 455, 570, 710, 890, 1110, 1390, 1735, 2170, 2715, 3390, 4240, 5300, 6625, 8280, 10350, 12940, 16175, 20215, 25270, 31590, 39485, 49355, 61695, 77120, 96400, 120500
Offset: 1

Views

Author

James Van Alstine, Jul 18 2014

Keywords

Examples

			The numbers 10..14 are represented by 430, 431, 432, 433, 434 respectively in base 5/4. These are the only numbers with three digits, and so a(3)=5.
		

Crossrefs

Programs

  • Sage
    A=[1]
    for i in [1..60]:
        A.append(ceil((5-4)/4*sum(A)))
    [5*x for x in A]

Formula

a(n) = 5*A120160(n).

A120160 a(n) = ceiling(Sum_{i=1..n-1} a(i)/4) for n >= 2 starting with a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 8, 10, 12, 15, 19, 24, 30, 37, 47, 58, 73, 91, 114, 142, 178, 222, 278, 347, 434, 543, 678, 848, 1060, 1325, 1656, 2070, 2588, 3235, 4043, 5054, 6318, 7897, 9871, 12339, 15424, 19280, 24100, 30125, 37656, 47070, 58838, 73547
Offset: 1

Views

Author

Graeme McRae, Jun 10 2006

Keywords

Comments

From Petros Hadjicostas, Jul 21 2020: (Start)
Conjecture 1: a(n) equals the number of multiples of 4 whose representation in base 5/4 (see A024634) has n-1 digits. For example, a(8) = 3 because there are three multiples of 4 with n-1 = 7 digits in their representation in base 5/4: 36 = 4321031, 40 = 4321420, and 44 = 4321424.
Conjecture 2: a(n) equals 1/5 times the number of nonnegative integers with the property that their 5/4-expansion has n digits (assuming that the 5/4-expansion of 0 has 1 digit). For example, a(7)*5 = 10 because the following 10 numbers have 5/4 expansions with n = 7 digits: 35 = 4321030, 36 = 4321031, 37 = 4321032, 38 = 4321033, 39 = 4321034, 40 = 4321420, 41 = 4321421, 42 = 4321422, 43 = 4321423, and 44 = 4321424. (End)
From Petros Hadjicostas, Jul 23 2020: (Start)
Starting at a(11) = 5, we conjecture that this sequence gives all those numbers m for which when we place m persons on a circle, label them 1 through m, start counting at person number 1, and remove every 5th person, the last survivors have numbers in {1, 2, 3, 4}.
When m = 6, 12, 15, 37, 58, 142, 222, 347, ... the last survivor is person 1.
When m = 5, 19, 91, 434, 1656, 2070, 5054, ... the last survivor is person 2.
When m = 8, 10, 24, 30, 73, 114, 178, 278, ... the last survivor is person 3.
When m = 47, 543, 2588, 3235, 6318, 58838, ... the last survivor is person 4. (End)

Examples

			From _Petros Hadjicostas_, Jul 23 2020: (Start)
We explain why 6 and 8 belong to the sequence related to the Josephus problem (for the case k = 5) while 7 does not.
When we place m = 6 people on a circle, label them 1 through 6, start counting at person 1, and remove every 5th person, the list of people we remove is 5 -> 4 -> 6 -> 2 -> 3. Thus the last survivor is person 1, so 6 belongs to this sequence.
When we place m = 7 people on a circle, label them 1 through 7, start counting at person 1, and remove every 5th person, the list of people we remove is 5 -> 3 -> 2 -> 4 -> 7 -> 1. Thus the last survivor is person 6 (not in {1, 2, 3, 4}), so 7 does not belong to this sequence.
When we place m = 8 people on a circle, label them 1 through 8, start the counting at person 1, and remove every 5th person, the list of people we remove is 5 -> 2 -> 8 -> 7 -> 1 -> 4 -> 6. Thus the last survivor is 3, so 8 belongs to this sequence. (End)
		

Crossrefs

Programs

  • Magma
    function f(n, a, b)
      t:=0;
        for k in [1..n-1] do
          t+:= a+Ceiling((b+t)/4);
        end for;
      return t;
    end function;
    g:= func< n, a, b | f(n+1, a, b)-f(n, a, b) >;
    A120160:= func< n | n le 4 select 1 else g(n-4, 1, 0) >;
    [A120160(n): n in [1..60]]; // G. C. Greubel, Sep 01 2023
    
  • Mathematica
    f[s_]:= Append[s, Ceiling[Plus @@ s/4]]; Nest[f,1,53] (* Robert G. Wilson v *)
    (* Second program *)
    f[n_]:= f[n]= 1 + Quotient[Sum[f[k], {k,n-1}], 4];
    A120160[n_]:= If[n==1, 1, f[n-1]];
    Table[A120160[n], {n, 60}] (* G. C. Greubel, Sep 01 2023 *)
  • PARI
    /* PARI program for the general case of Josephus problem. We use the Burde-Thériault algorithm. Here k = 5. To get the corresponding last survivors, modify the program to get the vector j. */
    lista(nn, k) = {my(j=vector(nn)); my(f=vector(nn)); my(N=vector(nn));
    j[1]=1; f[1]=0; N[1] = 1;
    for(n=1, nn-1, f[n+1] = ((j[n]-N[n]-1) % (k-1)) + 1 - j[n];
    j[n+1] = j[n] + f[n+1]; N[n+1] = (k*N[n] + f[n+1])/(k-1); );
    for(n=1, nn, if(N[n] > k-1, print1(N[n], ", "))); } \\ Petros Hadjicostas, Jul 23 2020
    
  • SageMath
    @CachedFunction
    def A120160(n): return 1 + ceil( sum(A120160(k) for k in range(1,n))//4 )
    [A120160(n) for n in range(1,61)] # G. C. Greubel, Sep 01 2023

Extensions

Edited and extended by Robert G. Wilson v, Jul 07 2006
Appended the first missing term. - Tom Edgar, Jul 18 2014

A245335 Sum of digits of n in fractional base 5/4.

Original entry on oeis.org

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

Views

Author

James Van Alstine, Jul 18 2014

Keywords

Comments

The base 5/4 expansion is unique and thus the sum of digits function is well-defined.

Examples

			In base 5/4 the number 7 is represented by 42 and so a(7) = 4+2 = 6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, a[4 * Floor[n/5]] + Mod[n, 5]]; Array[a, 100, 0] (* Amiram Eldar, Jul 31 2025 *)
  • PARI
    a(n) = my(ret=0,r); while(n, [n,r]=divrem(n,5); ret+=r; n<<=2); ret; \\ Kevin Ryde, Aug 11 2023
  • Sage
    # uses [basepqsum from A245355]
    [basepqsum(5,4,y) for y in [0..200]]
    

Formula

a(n) = A007953(A024634(n)). - Kevin Ryde, Aug 11 2023
Showing 1-3 of 3 results.