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 18 results. Next

A342426 Niven numbers in base 3/2: numbers divisible by their sum of digits in fractional base 3/2 (A244040).

Original entry on oeis.org

1, 2, 6, 9, 14, 21, 40, 42, 56, 72, 84, 108, 110, 120, 126, 130, 143, 154, 156, 162, 165, 168, 169, 176, 180, 182, 189, 198, 220, 225, 231, 243, 252, 280, 288, 297, 306, 308, 320, 322, 330, 336, 348, 350, 364, 390, 423, 430, 432, 459, 460, 462, 480, 490, 504
Offset: 1

Views

Author

Amiram Eldar, Mar 11 2021

Keywords

Examples

			6 is a term since its representation in base 3/2 is 210 and 2 + 1 + 0 = 3 is a divisor of 6.
9 is a term since its representation in base 3/2 is 2100 and 2 + 1 + 0 + 0 = 3 is a divisor of 9.
		

Crossrefs

Subsequences: A342427, A342428, A342429.
Similar sequences: A005349 (decimal), A049445 (binary), A064150 (ternary), A064438 (quaternary), A064481 (base 5), A118363 (factorial), A328208 (Zeckendorf), A328212 (lazy Fibonacci), A331085 (negaFibonacci), A333426 (primorial), A334308 (base phi), A331728 (negabinary).

Programs

  • Mathematica
    s[0] = 0; s[n_] := s[n] = s[2*Floor[n/3]] + Mod[n, 3]; q[n_] := Divisible[n, s[n]]; Select[Range[500], q]

A024629 n written in fractional base 3/2.

Original entry on oeis.org

0, 1, 2, 20, 21, 22, 210, 211, 212, 2100, 2101, 2102, 2120, 2121, 2122, 21010, 21011, 21012, 21200, 21201, 21202, 21220, 21221, 21222, 210110, 210111, 210112, 212000, 212001, 212002, 212020, 212021, 212022, 212210, 212211, 212212, 2101100, 2101101
Offset: 0

Views

Author

Keywords

Comments

A246435(n) = (number of digits in a(n)) = A055642(a(n)). - Reinhard Zumkeller, Sep 05 2014
The number of positive even n such that a(n) has k+1 digits is A005428(k). - Glen Whitney, Jul 09 2017
The position of the rightmost "2" digit in a(3k), k >= 1, appears to be A087088(k). - Peter Munn, Jun 24 2020 [updated Peter Munn, Jul 14 2020 for new A087088 offset]

Examples

			Representations of the first few numbers are:
   0 =         0
   1 =         1
   2 =         2
   3 =       2 0
   4 =       2 1
   5 =       2 2
   6 =     2 1 0
   7 =     2 1 1
   8 =     2 1 2
   9 =   2 1 0 0
  10 =   2 1 0 1
  11 =   2 1 0 2
  12 =   2 1 2 0
  13 =   2 1 2 1
  14 =   2 1 2 2
  15 = 2 1 0 1 0
[extended and reformatted by _Peter Munn_, Jun 27 2020]
		

Crossrefs

Cf. A081848, A087088, A246435 (string lengths), A244040 (digit sums).

Programs

  • Haskell
    a024629 0 = 0
    a024629 n = 10 * a024629 (2 * n') + t where (n', t) = divMod n 3
    -- Reinhard Zumkeller, Sep 05 2014
  • Maple
    a:= proc(n) `if`(n<1, 0, irem(n, 3, 'q')+a(2*q)*10) end:
    seq(a(n), n=0..45);  # Alois P. Heinz, Jun 19 2018
  • Mathematica
    a[ n_] := If[ n < 1, 0, a[ Quotient[n, 3] 2] 10 + Mod[ n, 3]]; (* Michael Somos, Jun 18 2014 *)
  • PARI
    {a(n) = if( n<1, 0, a(n\3 * 2) * 10 + n%3)}; /* Michael Somos, Jun 18 2014 */
    
  • SageMath
    def basepqExpansion(p,q,n):
        L, i = [n], 1
        while L[i-1] >= p:
            x=L[i-1]
            L[i-1]=x.mod(p)
            L.append(q*(x//p))
            i+=1
        L.reverse()
        return Integer(''.join(str(x) for x in L))
    [basepqExpansion(3,2,n) for n in [0..40]] # Tom Edgar, Hailey R. Olafson, and James Van Alstine, Jun 17 2014; modified and corrected by G. C. Greubel, Aug 20 2019
    

Formula

To represent a number in base b, if a digit is >= b, subtract b and carry 1. In fractional base a/b, subtract a and carry b.
a(0)=0, a(3n+r) = 10*a(2n)+r for n >= 0 and r = 0, 1, 2. - Jianing Song, Oct 15 2022

Extensions

Tanton link corrected by Charles R Greathouse IV, Oct 20 2008

A245355 Sum of digits of n written in fractional base 8/5.

Original entry on oeis.org

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

Views

Author

Tom Edgar, Jul 18 2014

Keywords

Comments

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

Examples

			In base 8/5 the number 20 is represented by 524 and so a(20) = 5 + 2 + 4 = 11.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, a[5 * Floor[n/8]] + Mod[n, 8]]; Array[a, 100, 0] (* Amiram Eldar, Aug 02 2025 *)
  • PARI
    a(n) = if(n == 0, 0, a(n\8 * 5) + n % 8); \\ Amiram Eldar, Aug 02 2025
  • Sage
    def basepqsum(p, q, n):
        L = [n]
        i = 1
        while L[i-1]>=p:
            x=L[i-1]
            L[i-1]=x.mod(p)
            L.append(q*(x//p))
            i+=1
        return sum(L)
    [basepqsum(8,5,i) for i in [0..100]]
    

Formula

a(n) = A007953(A024647(n)).

A246435 Length of representation of n in fractional base 3/2.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 05 2014

Keywords

Crossrefs

Cf. A024629, A055642, A070989, A081604, A081848 (run lengths), A244040.

Programs

  • Haskell
    a246435 n = if n < 3 then 1 else a246435 (2 * div n 3) + 1
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Mathematica
    a[n_] := If[n < 3, 1, a[2 Quotient[n, 3]] + 1]; Array[a, 100, 0] (* Jean-François Alcover, Feb 05 2019 *)
  • PARI
    a(n) = if(n < 3, 1, a(n\3 * 2) + 1); \\ Amiram Eldar, Jul 30 2025

Formula

a(n) = if n < 3 then 1, otherwise a(2*floor(n/3)) + 1.
a(n) = A055642(A024629(n)).

A087088 Positive ruler-type fractal sequence with 1's in every third position.

Original entry on oeis.org

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

Views

Author

Enrico T. Federighi (rico125162(AT)aol.com), Aug 08 2003

Keywords

Comments

If all the terms in the sequence are reduced by one and then all zeros are removed, the result is the same as the original sequence.
From Benoit Cloitre, Mar 07 2009: (Start)
To construct the sequence:
Step 1: start from a sequence of 1's and leave two undefined places between every pair of 1's giving: 1,(),(),1,(),(),1,(),(),1,(),(),1,(),(),1,...
Step 2: replace the first undefined place with a 2 and henceforth leave two undefined places between two 2's giving: 1,2,(),1,(),2,1,(),(),1,2,(),1,(),2,1,...
Step 3: replace the first undefined place with a 3 and henceforth leave two undefined places between two 3's giving: 1,2,3,1,(),2,1,(),3,1,2,(),1,(),2,1,...
Step 4: replace the first undefined place with a 4 and leave 2 undefined places between two 4's giving: 1,2,3,1,4,2,1,(),3,1,2,(),1,4,2,1,... Iterating the process indefinitely yields the sequence: 1,2,3,1,4,2,1,5,3,1,2,6,1,4,2,1,... (End)
From Peter Munn, Jul 10 2020: (Start)
For k >= 1, the number k occurs in a pattern with fundamental period 3^k, and with points of mirror symmetry at intervals of (3^k)/2. Those points have an extrapolated common origin (for k >= 1) at an offset 1.5 to the left of the sequence's initial "1". The snake format illustration in the example section may be useful for visualizing this.
(End)
For k >= 1, k first occurs at position A061419(k) and its k-th occurrence is at position A083045(k-1). - Peter Munn, Aug 23 2020
(a(n)) is the unique fixed point of the two-block substitution a,b -> 1,a+1,b+1, where a,b are natural numbers. - Michel Dekking, Sep 26 2022

Examples

			From _Peter Munn_, Jul 03 2020: (Start)
Listing the terms in a snake format (with period 27) illustrates periodic and mirror symmetries. Horizontal lines mark points of mirror symmetry for 3's. Vertical lines mark further points of mirror symmetry for 2's. 79 terms are shown. (Referred to the extrapolated common origin of periodic mirror symmetry, the initial term is at offset 1.5 and the last shown is at offset 79.5 = 3^4 - 1.5.) Observe also mirror symmetry of 4's (seen vertically).
    1  2  3  1  4  2  1  5   3  1  2  6
             |             |            1 --
    1  2  3  1  5  2  1  7   3  1  2  4
_ 4
  8
    1  2  3  1  6  2  1  4   3  1  2  5
             |             |            1 --
    1  2  3  1  7  2  1  4   3  1  2  9
_ 5
  4
    1  2  3  1  6  2  1 10   3  1  2  4
             |             |            1 --
    1  2  3  1  4  2  1  8   3  1  2  5
(End)
From _Peter Munn_, Aug 22 2020: (Start)
The start of the sequence is shown below in conjunction with related sequences, aligning their points of mirror symmetry. The longer, and shorter, vertical lines indicate points of mirror symmetry for terms valued less than 4, and less than 3, respectively. Note each term of A051064 is the minimum of two terms displayed nearest below it, and each term of A254046 is the minimum of the two terms displayed diagonally above it.
        |                          |                          |
A051064:| 1 1 2 1 1 2 1 1 3 1 1 2 1 1 2 1 1 3 1 1 2 1 1 2 1 1 4 1 1 2
        |        |        |        |        |        |        |
[a(n)]: |  1 2 3 1 4 2 1 5 3 1 2 6 1 4 2 1 3 7 1 2 5 1 3 2 1 4 8 1 2 3
        |        |        |        |        |        |        |
A254046:|1 2 1 1 3 1 1 2 1 1 2 1 1 4 1 1 2 1 1 2 1 1 3 1 1 2 1 1 2 1 1
        |                          |                          |
(End)
		

Crossrefs

Sequences with equivalent symmetries: A051064, A254046.
Records are given by A061419: a(A061419(n))=n.
Essentially the odd bisection of A335933.
Sequence with similar definition: A087165.
Ordinal transform of A163491, with which this sequence has a joint relationship to A083044, A083045.
See also the comment in A024629.

Programs

Formula

a(n) = 1 when n == 1 (mod 3), otherwise a(n) = a(n-ceiling(n/3)) + 1.
a(n) = 3 + A244040(3*(n-1)) - A244040(3*n). - Tom Edgar and James Van Alstine, Aug 04 2014
From Peter Munn, Aug 22 2020: (Start)
For m >= 0, a(3*m+1) = 1; a(3*m+2) = a(2*m+1) + 1; a(3*m+3) = a(2*m+2) + 1.
For n >= 1, the following identities hold.
a(n) = A335933(2*n+1).
A083044(A163491(n) - 1, a(n) - 1) = n.
A051064(n+1) = min(a(n), a(n+1)).
A254046(n+2) = min(a(n), a(n+2)). (End)

Extensions

More terms from Paul D. Hanna, Aug 21 2003
Offset changed by M. F. Hasler (following remarks by Peter Munn), Jul 13 2020
Thanks to Allan C. Wechsler for suggesting the new name. - N. J. A. Sloane, Jul 14 2020

A244041 Sum of digits of n written in fractional base 4/3.

Original entry on oeis.org

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

Views

Author

Hailey R. Olafson, Jun 17 2014

Keywords

Comments

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

Examples

			In base 4/3 the number 14 is represented by 3212 and so a(14) = 3 + 2 + 1 + 2 = 8.
		

Crossrefs

Programs

  • Mathematica
    p:=4; q:=3; a[n_]:= a[n]= If[n==0, 0, a[q*Floor[n/p]] + Mod[n, p]]; Table[a[n], {n,0,75}] (* G. C. Greubel, Aug 20 2019 *)
  • PARI
    a(n) = p=4; q=3; if(n==0,0, a(q*(n\p)) + (n%p));
    vector(75, n, n--; a(n)) \\ G. C. Greubel, Aug 20 2019
  • Sage
    def base43sum(n):
        L, i = [n], 1
        while L[i-1]>3:
            x=L[i-1]
            L[i-1]=x.mod(4)
            L.append(3*floor(x/4))
            i+=1
        return sum(L)
    [base43sum(n) for n in [0..75]]
    

Formula

a(n) = A007953(A024631(n)). - Michel Marcus, Jun 17 2014
a(n) < 3 log(n)/log(4/3) < 11 log(n) for n > 1. Possibly the constant factor can be replaced by 7 or 8. - Charles R Greathouse IV, Sep 22 2022
Conjecture: a(n) >> log(n), hence a(n) ≍ log(n). - Charles R Greathouse IV, Nov 03 2022

A245321 Sum of digits of n written in fractional base 6/5.

Original entry on oeis.org

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

Views

Author

Tom Edgar, Jul 18 2014

Keywords

Comments

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

Examples

			In base 6/5 the number 15 is represented by 543 and so a(15) = 5 + 4 + 3 = 12.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n<1, 0, irem(n, 6, 'q')+a(5*q)) end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Aug 19 2019
  • Mathematica
    a[n_]:= a[n] = If[n==0, 0, a[5*Floor[n/6]] + Mod[n,6]]; Table[a[n], {n, 0, 70}] (* G. C. Greubel, Aug 19 2019 *)
  • PARI
    a(n) = if(n == 0, 0, a(n\6 * 5) + n % 6); \\ Amiram Eldar, Jul 31 2025
  • Sage
    def basepqsum(p,q,n):
        L=[n]
        i=1
        while L[i-1]>=p:
            x=L[i-1]
            L[i-1]=x.mod(p)
            L.append(q*(x//p))
            i+=1
        return sum(L)
    [basepqsum(6,5,i) for i in [0..70]]
    

Formula

a(n) = A007953(A024638(n)).

A245336 Sum of digits of n written in fractional base 8/7.

Original entry on oeis.org

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

Views

Author

Hailey R. Olafson, Jul 18 2014

Keywords

Comments

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

Examples

			In base 8/7 the number 14 is represented by 76 and so a(14) = 7 + 6 = 13.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, a[7 * Floor[n/8]] + Mod[n, 8]]; Array[a, 100, 0] (* Amiram Eldar, Aug 02 2025 *)
  • PARI
    a(n) = if(n == 0, 0, a(n\8 * 7) + n % 8); \\ Amiram Eldar, Aug 02 2025
  • Sage
    # uses [basepqsum from A245355]
    [basepqsum(8,7,w) for w in [0..200]]
    

Formula

a(n) = A007953(A024649(n)).

A245338 Sum of digits of n written in fractional base 9/8.

Original entry on oeis.org

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

Views

Author

Tom Edgar, Jul 18 2014

Keywords

Comments

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

Examples

			In base 9/8 the number 16 is represented by 87 and so a(16) = 8 + 7 = 15.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, a[8 * Floor[n/9]] + Mod[n, 9]]; Array[a, 100, 0] (* Amiram Eldar, Aug 04 2025 *)
  • PARI
    a(n) = if(n == 0, 0, a(n\9 * 8) + n % 9); \\ Amiram Eldar, Aug 04 2025
  • Sage
    # uses [basepqsum from A245355]
    [basepqsum(9,8,i) for i in [0..100]]
    

Formula

a(n) = A007953(A024656(n)).

A245339 Sum of digits of n written in fractional base 10/9.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 39, 40, 41, 42, 43, 44, 45, 46
Offset: 0

Views

Author

Hailey R. Olafson, Jul 18 2014

Keywords

Comments

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

Examples

			In base 10/9 the number 14 is represented by 94 and so a(14) = 9 + 4 = 13.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, a[9 * Floor[n/10]] + Mod[n, 10]]; Array[a, 100, 0] (* Amiram Eldar, Aug 04 2025 *)
  • PARI
    a(n) = if(n == 0, 0, a(n\10 * 9) + n % 10); \\ Amiram Eldar, Aug 04 2025
  • Sage
    # uses [basepqsum from A245355]
    [basepqsum(10,9,w) for w in [0..200]]
    

Formula

a(n) = A007953(A024664(n)).
Showing 1-10 of 18 results. Next