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.

User: Miquel Cerda

Miquel Cerda's wiki page.

Miquel Cerda has authored 13 sequences. Here are the ten most recent ones:

A385893 Cycle of length 130 in the dynamical system A385938 starting from 26.

Original entry on oeis.org

26, 61, 41, 96, 64, 43, 29, 68, 159, 106, 71, 166, 111, 74, 173, 404, 943, 629, 1468, 979, 653, 1524, 1016, 2371, 1581, 1054, 703, 469, 313, 209, 488, 1139, 2658, 1772, 4135, 2757, 1838, 4289, 10008, 6672, 4448, 10379, 24218, 56509, 37673, 87904, 58603, 39069, 26046, 17364
Offset: 0

Author

Miquel Cerda, Jul 12 2025

Keywords

Comments

Starting from 26, iteration of A385938 returns to 26 after exactly 130 steps.
The dynamical system has four attractors: fixed point 1, and cycles of lengths 10, 68, and 130.
Any element in this cycle generates the complete 130-elements cycle when iterated.

Examples

			Starting from 26: f(26) = (7*26+1)/3 = 61, f(61) = (2*61+1)/3 = 41, continuing this process yields the 130-element cycle.
		

Crossrefs

Cf. A385938 (the function defining this dynamical system).

Programs

  • Mathematica
    f[x_] := Which[Mod[x, 3] == 0, 2*x/3, Mod[x, 3] == 1, (2*x + 1)/3, Mod[x, 3] == 2, (7*x + 1)/3]; NestList[f, 26, 129]
  • PARI
    my(v=vector(130)); v[1]=26; for(i=2,130, x=v[i-1]; v[i]=if(x%3==0,2*x/3,if(x%3==1,(2*x+1)/3,(7*x+1)/3))); v;

Formula

a(0) = 26; a(n) = A385938(a(n-1)) for n >= 1.

A385938 a(n) = 2*n/3 if n == 0 (mod 3), (2*n+1)/3 if n == 1 (mod 3), (7*n+1)/3 if n == 2 (mod 3).

Original entry on oeis.org

0, 1, 5, 2, 3, 12, 4, 5, 19, 6, 7, 26, 8, 9, 33, 10, 11, 40, 12, 13, 47, 14, 15, 54, 16, 17, 61, 18, 19, 68, 20, 21, 75, 22, 23, 82, 24, 25, 89, 26, 27, 96, 28, 29, 103, 30, 31, 110, 32, 33, 117, 34, 35, 124, 36, 37, 131, 38, 39, 138, 40, 41, 145, 42, 43, 152, 44, 45, 159
Offset: 0

Author

Miquel Cerda, Jul 13 2025

Keywords

Comments

Ternary modular function with three cases based on residue modulo 3.
The function defines a dynamical system with multiple periodic attractors.
Fixed point at 1: a(1) = 1.
From Miquel Cerda, Aug 06 2025: (Start)
Every nonnegative integer k appears at least once as a value in the sequence.
Inverse formulas (for possible preimages):
If k is even: one preimage is n = 3*k/2.
If k is odd: one preimage is n = (3*k - 1)/2.
If k == 5 (mod 7): there is an additional preimage: n = 3*(k - 5)/7 + 2. (End)

Examples

			a(0) = 2*0/3 = 0. a(1) = (2*1+1)/3 = 1. a(2) = (7*2+1)/3 = 5. a(3) = 2*3/3 = 2.
		

Crossrefs

Cf. A385893 (cycle of length 130 in this dynamical system).
Cf. A332057 (near definition).

Programs

  • Mathematica
    a[x_] := Which[Mod[x, 3] == 0, 2*x/3, Mod[x, 3] == 1, (2*x + 1)/3, Mod[x, 3] == 2, (7*x + 1)/3]; Table[a[n], {n, 0, 50}]
  • PARI
    a(n) = if(n%3==0, 2*n/3, if(n%3==1, (2*n+1)/3, (7*n+1)/3))
    
  • Python
    def A385938(n):
        q, r = divmod(n,3)
        return (q<<1)+r if r<2 else 7*q+5 # Chai Wah Wu, Jul 17 2025

Formula

G.f.: x*(1+5*x+2*x^2+x^3+2*x^4) / ( (x-1)^2*(1+x+x^2)^2 ). - R. J. Mathar, Jul 30 2025

A382531 Number of n-digit base-10 numbers whose digit sum is equal to ceiling(9*n/2).

Original entry on oeis.org

1, 9, 70, 615, 5520, 50412, 468448, 4379055, 41395240, 392406145, 3748943890, 35866068766, 345143007910, 3323483518810, 32150758083580, 311088525668335, 3021445494584902, 29344719005694973, 285904843977651598, 2785022004925340460, 27203012941819689340
Offset: 1

Author

Miquel Cerda, Mar 30 2025

Keywords

Comments

Digit sum ceiling(9*n/2) = A130877(n+1) has highest frequency among all n-digit base-10 numbers.
The count excludes numbers with leading zeros.

Examples

			a(2) = 9, the 2-digit numbers with digit sum 9 are: 18, 27, 36, 45, 54, 63, 72, 81, 90.
		

Crossrefs

Cf. A210736 (analogous for base-2 digits).
Cf. A025015 (maximal coefficient of (1+...+x^9)^n).

Programs

  • Maple
    b:= proc(n, s, t) option remember; `if`(9*n b(n, ceil(9*n/2), 1):
    seq(a(n), n=1..23);  # Alois P. Heinz, Apr 12 2025

Formula

a(n) = [x^ceiling(9*n/2)] (f^n - f^(n-1)) with f = (x^10-1)/(x-1). - Alois P. Heinz, Apr 12 2025

A289762 Triangular array T(m,k) = (m+1-k)^2 + k - 1 with m (row) >= 1 and k (column) >= 1, read by rows.

Original entry on oeis.org

1, 1, 4, 2, 2, 4, 9, 5, 3, 3, 5, 9, 16, 10, 6, 4, 4, 6, 10, 16, 25, 17, 11, 7, 5, 5, 7, 11, 17, 25, 36, 26, 18, 12, 8, 6, 6, 8, 12, 18, 26, 36, 49, 37, 27, 19, 13, 9, 7, 7, 9, 13, 19, 27, 37, 49, 64, 50, 38, 28, 20, 14, 10, 8, 8, 10, 14, 20, 28, 38, 50, 64, 81, 65, 51, 39, 29, 21, 15, 11, 9
Offset: 1

Author

Miquel Cerda, Jul 12 2017

Keywords

Comments

The n-th row is of length = max(2n, 1) and the row sum is (2n^3 + 6n^2 - 2n) / 3.
Rows m = 2, 3, 5, 11, and 41 (Euler's lucky numbers) give the prime numbers generated by the famous polynomials, but twice each one between m^2.

Examples

			The m-th row start and end: T(m,1) = m^2, ..., T(m,2m) = m^2.
In general T(m,k) = T(m,2m+1-k).
m\k    1     2     3     4     5     6     7     8     9     10
1      1,    1,
2      4,    2,    2,    4
3      9,    5,    3,    3,    5,    9
4      16,   10,   6,    4,    4,    6,    10,   16
5      25,   17,   11,   7,    5,    5,    7,    11,   17,   25
6      36,   26,   18,   12,   8,    6,    6,    8,    12,   18, ...
7      49,   37,   27,   19,   13,   9,    7,    7,    9,    13, ...
8      64,   50,   38,   28,   20,   14,   10,   8,    8,    10, ...
9      81,   65,   51,   39,   29,   21,   15,   11,   9,    9, ...
10     100,  82,   66,   52,   40,   30    22,   16,   12,   10, ...
The T(m,k) sequence as an isosceles triangle:
                                     1  1
                                 4   2  2  4
                             9   5   3  3  5  9
                         16  10  6   4  4  6  10  16
                     25  17  11  7   5  5  7  11  17  25
                 36  26  18  12  8   6  6  8  12  18  26  36
             49  37  27  19  13  9   7  7  9  13  19  27  37  49
         64  50  38  28  20  14  10  8  8  1  14  20  28  38  50  64
     81  65  51  39  29  21  15  11  9  9  11 15  21  29  39  51  65  81
100  82  66  52  40  30  22  16  12  10 10 12 16  22  30  40  52  66  82  100
		

Crossrefs

m(41, k+1) = A060566(n), left and right border gives A000290(n).

Programs

Formula

The formula that gives the integers in the m-th rows can be expressed using quadratic polynomials:
for row m = 1, a(k) = k^2 - 3*k + 3
for row m = 2, a(k) = k^2 - 5*k + 8
for row m = 3, a(k) = k^2 - 7*k + 15
for row m = 4, a(k) = k^2 - 9*k + 24
for row m = 5, a(k) = k^2 - 11*k + 35
for row m = 6, a(k) = k^2 - 13*k + 48
etc.

A289642 Number of 2-digit numbers whose digits add up to n.

Original entry on oeis.org

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

Author

Miquel Cerda, Jul 09 2017

Keywords

Comments

The 2-digit numbers distributed according to the sum of their digits n.
Symmetrical sequence; a(n) = a(19 - n).

Examples

			n(5) = 5 because there are 5 numbers whose digits sum = 5 (14, 23, 32, 41, 50).
		

Crossrefs

Cf. A071817 (3-digit numbers), A090579 (4-digit numbers), A090580 (5-digit numbers), A090581 (6-digit numbers), A278969 (7-digit numbers), A278971 (8-digit numbers), A289354 (9-digit numbers), A053188, A074989, A004739, A066635, A154840, A249121.

Formula

G.f.: (1 - x^10)*(x - x^10)/(1 - x)^2.
a(n) = (19-abs(n-9)-abs(n-10))/2 for n=1..18. - Wesley Ivan Hurt, Jul 09 2017

A289410 Irregular triangular array T(m,k) with m (row) >= 1 and k (column) >= 1 read by rows: number of m-digit numbers whose digit sum is k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 3, 6, 10, 15, 21, 28, 36, 45, 54, 61, 66, 69, 70, 69, 66, 61, 54, 45, 36, 28, 21, 15, 10, 6, 3, 1, 1, 4, 10, 20, 35, 56, 84, 120, 165, 219, 279, 342, 405, 465, 519, 564, 597, 615, 615, 597, 564, 519, 465, 405, 342, 279, 219, 165, 120, 84
Offset: 1

Author

Miquel Cerda, Jul 05 2017

Keywords

Comments

The m-th row is palindromic; T(m,k) = T(m,9*m+1-k).

Examples

			The irregular triangle T(m,k) begins:
m\k  1  2  3  4  5   6   7   8   9   10   11  12   13   14  15  16  17  18  19
1    1  1  1  1  1   1   1   1   1;
2    1  2  3  4  5   6   7   8   9    9    8   7    6    5   4   3   2   1;
3    1  3  6  10 15  21  28  36  45   54   61  66   69   70  69  66  61  54 45,...;
4    1  4  10 20 35  56  84  120 165  219  279 342  405  465,...;
5    1  5  15 35 70  126 210 330 495  714  992 1330 1725,...;
6    1  6  21 56 126 252 462 792 1287 2001 2992,...;
etc.
Row m(2), column k(4) there are 4 numbers of 2-digits whose digits sum = 4: 13, 22, 31, 40.
		

Crossrefs

The row sums = 9*10^(m-1) = A052268(n). The row lengths = 9*m = A008591(n). The middle diagonal = A071976. (row m=3) = A071817, (row m=4) = A090579, (row m=5) = A090580, (row m=6) = A090581, (row m=7) = A278969, (row m=8) = A278971, (row m=9) = A289354, (column k=3) = A000217, (column k=4) = A000292, (column k=5) = A000332, (column k=6) = A000389, (column k=7) = A000579, (column k=8) = A000580, (column k=9) = A000581, (column k=10) = A035927.

Programs

  • Maple
    row:= proc(m) local g; g:= normal((1 - x^10)^(m-1)*(x - x^10)/(1 - x)^m);
    seq(coeff(g,x,j),j=1..9*m) end proc:
    seq(row(k),k=1..5); # Robert Israel, Jul 19 2017

Formula

G.f. of row m: (1 - x^10)^(m-1)*(x - x^10)/(1 - x)^m.
G.f. as array: (1+x+x^2)*(1+x^3+x^6)*x*y/(1-y*(1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8+x^9)). - Robert Israel, Jul 19 2017

Extensions

Edited by Robert Israel, Jul 19 2017

A289380 Number of 10-digit numbers whose sum of digits is n.

Original entry on oeis.org

1, 10, 55, 220, 715, 2002, 5005, 11440, 24310, 48619, 92359, 167815, 293215, 494725, 808753, 1284481, 1986490, 2997280, 4419415, 6376951, 9015769, 12502435, 17021245, 22769185, 29948644, 38757862, 49379275, 61966135, 76628035, 93416221, 112309741, 133203565, 155899810, 180103120
Offset: 1

Author

Miquel Cerda, Jul 04 2017

Keywords

Comments

The 10-digit numbers distributed according to the sum of their digits n.
The sequence is symmetrical; a(n) = a(91 - n), 1 <= n <= 91.

Examples

			a(2)=10: 1000000001, 1000000010, 1000000100, 1000001000, 1000010000, 1000100000, 1001000000, 1010000000, 110000000, 200000000.
		

Crossrefs

Cf. A071817 (3-digit numbers), A090579 (4-digit numbers), A090580 (5-digit numbers), A090581 (6-digit numbers), A278969 (7-digit numbers), A278971 (8-digit numbers), A289354 (9-digit numbers).

Programs

  • Mathematica
    CoefficientList[Series[(1 - x^10)^9*(1 - x^9)/(1 - x)^10, {x, 0, 40}],
    x] (* Wesley Ivan Hurt, Jul 09 2017 *)

Formula

G.f.: (1 - x^10)^9*(x - x^10)/(1 - x)^10.

A289354 Number of 9-digit numbers whose sum of digits is n.

Original entry on oeis.org

1, 9, 45, 165, 495, 1287, 3003, 6435, 12870, 24309, 43741, 75465, 125445, 201675, 314523, 477015, 705012, 1017225, 1435005, 1981845, 2682559, 3562131, 4644255, 5949615, 7493982, 9286233, 11326425, 13604085, 16096905, 18770031, 21576079, 24455955, 27340500, 30152925, 32811945, 35235465, 37344615, 39067875, 40344975, 41130255, 41395240, 41130255, 40344975, 39067875, 37344615, 35235465, 32811945, 30152925, 27340500, 24455955, 21576079, 18770031, 16096905, 13604085, 11326425, 9286233, 7493982, 5949615, 4644255, 3562131, 2682559, 1981845, 1435005, 1017225, 705012, 477015, 314523, 201675, 125445, 75465, 43741, 24309, 12870, 6432, 3003, 1287, 495, 165, 45, 9, 1
Offset: 1

Author

Miquel Cerda, Jul 03 2017

Keywords

Comments

There are 900000000 numbers with 9 decimal digits, the smallest being 100000000 and the largest 999999999.

Examples

			a(2)=9: 100000001, 100000010, 100000100, 100001000, 100010000, 100100000, 101000000, 11000000, 20000000.
		

Crossrefs

Cf. A071817 (3-digit numbers), A090579 (4-digit numbers), A090580 (5-digit numbers), A090581 (6-digit numbers), A278969 (7-digit numbers), A278971 (8-digit numbers).

Programs

  • Mathematica
    With[{d = 9}, Rest@ CoefficientList[Series[(x - x^10)/(1 - x) ((1 - x^10)/(1 - x))^(d - 1), {x, 0, 9 d}], x]] (* Michael De Vlieger, Jul 04 2017 *)

Formula

a(n) = a(82 - n). - David A. Corneth, Jul 03 2017
G.f.: (x - x^10)/(1 - x)*((1 - x^10)/(1 - x))^8 - Michael De Vlieger, Jul 04 2017

A277757 a(n) = 2^(6*n + 1).

Original entry on oeis.org

2, 128, 8192, 524288, 33554432, 2147483648, 137438953472, 8796093022208, 562949953421312, 36028797018963968, 2305843009213693952, 147573952589676412928, 9444732965739290427392, 604462909807314587353088, 38685626227668133590597632
Offset: 0

Author

Miquel Cerda, Oct 28 2016

Keywords

Comments

Additive digital root of a(n) = 2.

Crossrefs

Formula

a(n) = 64*a(n-1).
From R. J. Mathar, Dec 02 2016: (Start)
G.f.: 2/(1-64*x).
a(n) = 2*A089357(n). (End)
From Elmo R. Oliveira, Feb 20 2025: (Start)
E.g.f.: 2*exp(64*x).
a(n) = A000079(A016921(n)). (End)

A277426 a(n) = 2^(6n+5).

Original entry on oeis.org

32, 2048, 131072, 8388608, 536870912, 34359738368, 2199023255552, 140737488355328, 9007199254740992, 576460752303423488, 36893488147419103232, 2361183241434822606848, 151115727451828646838272, 9671406556917033397649408, 618970019642690137449562112, 39614081257132168796771975168
Offset: 0

Author

Miquel Cerda, Oct 28 2016

Keywords

Comments

Additive digital root of a(n) = 5.

Programs

  • Mathematica
    CoefficientList[Series[32 / (1 - 64 x), {x, 0, 20}], x] (* Vincenzo Librandi, Oct 30 2016 *)

Formula

a(n) = 64*a(n-1).
G.f.: 32/(1-64*x). - Vincenzo Librandi, Oct 30 2016