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: , b

, b's wiki page.

, b has authored 268 sequences. Here are the ten most recent ones:

A385108 Triangle a(n,k) read by antidiagonals: a(n,k) is the number of dots in the k-augmented centered triangle of order n, k>=0, n>=1.

Original entry on oeis.org

1, 1, 4, 1, 10, 10, 1, 31, 31, 19, 1, 109, 109, 64, 31, 1, 409, 409, 235, 109, 46, 1, 1585, 1585, 901, 409, 166, 64, 1, 6241, 6241, 3529, 1585, 631, 235, 85, 1, 24769, 24769, 13969, 6241, 2461, 901, 316, 109, 1, 98689, 98689, 55585, 24769, 9721, 3529, 1219, 409, 136
Offset: 1

Author

Noel B. Lacpao, Jun 18 2025

Keywords

Comments

The k-augmented centered triangular numbers a(n,k) count the number of dots in the k-augmented centered triangle of order n. The order, n, refers to the number of exact dots along each side of the base equilateral triangle in the initial unaugmented centered triangle. For k=0, the configuration is simply this base triangle. It would be a single dot for n=1 or for n>=2, a central dot surrounded by dots so that each side contains exactly n dots. For k>=1, the k-augmented centered triangle of order n is recursively constructed by taking a (k-1)-augmented centered triangle of order n and attaching one congruent copy on each side. Each copy shares a whole side with the central triangle. Any overlapping dots that occur along the shared sides and vertices are counted only once. This recursive construction generalizes the classic centered triangular numbers. As k increases, it produces more complex and symmetric triangular patterns.
For k=0, a(n,0) gives the centered triangular numbers (A005448).
For k=1, a(n,1) matches A085473.
When k=2, a(n,1) matches the truncated hex numbers A381424.
The rows appear to be new for all k>=3.
For geometric illustrations, see the linked images.

Examples

			For n=1, any k:
a(1,k) = 4^k*(3*1^2-3*1+2)/2 - 3*1*Sum_{j=1..k} 4^(k-j)*2^(j-1) + 3*Sum_{j=1..k} 4^{k-j}*(2^{j-1}-1)
       = 4^k*1 - 3*Sum_{j=1..k} 4^(k-j)*2^(j-1) + 3*Sum_{j=1..k} 4^(k-j)*2^(j-1) - 3*Sum_{j=1..k} 4^(k-j)
       = 4^k-3*Sum_{j=1..k} 4^(k-j)
       = 4^k-3*(4^k-1)/3
       = 4^k-4^k+1
       = 1.
For n=2,k=0:
a(2,0) = 4^0*(3*2^2-3*2+2)/2
       = 8/2
       = 4.
For n=3, k=2:
a(3,2) = 4^2*(3*3^2-3*3+2)/2 - 3*3*Sum_{j=1..2} 4^(2-j)*2^(j-1) + 3*Sum_{j=1..22} 4^(2-j)*(2^(j-1)-1)
       = 16*20/2-9*6+3*1
       = 109.
Square array begins:
   1,   1,    1,    1,     1,     1,      1,       1, ...
   4,  10,   31,  109,   409,  1585,   6241,   24769, ...
  10,  31,  109,  409,  1585,  6241,  24769,   98689, ...
  19,  64,  235,  901,  3529, 13969,  55585,  221761, ...
  31, 109,  409, 1585,  6241, 24769,  98689,  393985, ...
  46, 166,  631, 2461,  9721, 38641, 154081,  615361, ...
  64, 235,  901, 3529, 13969, 55585, 221761,  885889, ...
  85, 316, 1219, 4789, 18985, 75601, 301729, 1205569, ...
		

Crossrefs

Programs

  • Maple
    a := proc(n, k)
       local S1, S2, j;
       S1 := add(4^(k-j)*2^(j-1), j=1..k);
       S2 := add(4^(k-j)*(2^(j-1)-1), j=1..k);
       return 4^k*(3*n^2 - 3*n + 2)/2 - 3*n*S1 + 3*S2;
    end proc:
    seq(seq(a(n,d-n), n=1..d), d=1..10);
  • Mathematica
    a[n_, k_] := Module[{S1, S2},
      S1 = Sum[4^(k - j) * 2^(j - 1), {j, 1, k}];
      S2 = Sum[4^(k - j) * (2^(j - 1) - 1), {j, 1, k}];
      4^k * (3 n^2 - 3 n + 2)/2 - 3 n * S1 + 3 * S2
    ];
    Table[a[n, k], {n, 1, 5}, {k, 0, 5}]
    TableForm[Table[a[n, k], {n, 1, 5}, {k, 0, 5}]]
  • Python
    def a(n, k):
         return 4**k*(3*n**2-3*n+2)//2-3*n*sum(4**(k-j)*2**(j-1) for j in range(1,k+1))+ 3*sum(4**(k-j)*(2**(j-1)-1) for j in range(1,k+1))
    for n in range(1, 10):
         row = [a(n, k)
    for k in range(0, 10)]
         print(row)
    
  • Python
    # For the antidiagonal terms.
    def a(n,k):
        term1 = 4**k * (3*n**2 - 3*n + 2) // 2
        if k == 0:
            return term1
        return term1 - 3*n*sum([4**(k-j) * 2**(j-1) for j in range(1, k+1)]) + 3*sum([4**(k-j) * (2**(j-1) - 1) for j in range(1, k+1)])
    def antidiagonal_sequence(num_terms):
        terms = []
        diag = 0
        while len(terms) < num_terms:
            for n in range(1, diag+2):
                k = diag - (n-1)
                if k < 0:
                    continue
                terms.append(a(n, k))
                if len(terms) == num_terms:
                    break
            diag += 1
        return terms
    N = 55
    seq = antidiagonal_sequence(N)
    print(', '.join(str(x) for x in seq))

Formula

a(n,k) = 4^k * (3*n^2-3*n+2) / 2 - 3*n * Sum_{j=1..k} 4^(k-j) * 2^(j-1) + 3 * Sum_{j=1..k} 4^(k-j) * (2^(j-1)-1).
a(n,k) = 4 * a(n,k-1) - 3 * (2^(k-1) * n - (2^(k-1)-1)).
G.f. for fixed k: G_k(x) = (A_kx(x+1) + B_kx(1-x) + C_kx(1-x)^2) / (1-x)^3, where a(n,k)=A_kn^2 + B_kn + C_k.

A382251 a(n) = 7*n^3 - 6*n^2.

Original entry on oeis.org

1, 32, 135, 352, 725, 1296, 2107, 3200, 4617, 6400, 8591, 11232, 14365, 18032, 22275, 27136, 32657, 38880, 45847, 53600, 62181, 71632, 81995, 93312, 105625, 118976, 133407, 148960, 165677, 183600, 202771, 223232, 245025, 268192, 292775, 318816, 346357, 375440, 406107, 438400, 472361
Offset: 1

Author

Noel B. Lacpao, May 17 2025

Keywords

Comments

Consider a figurate cubic number of the form a(n)=n^3. n is interpreted as the number of dots or nodes in each edge of the cube. Refer this cube as "central cube". Suppose one identical cube is attached to each of its six faces of the central cube. The resulting geometric structure consists of a total of seven arranged cubes so that each of the six surrounding cubes shares an entire face with the central cube. The overlapping dots along these shared faces are counted once. The number of dots in this configuration is given by the formula: a(n) = 7*n^3-6*n^2 for n>=1.

Examples

			For n=2, a(2) = 7*(2^3) - 6*(2^2) = 32.
For n=5, a(5) = 7*(5^3) - 6*(5^2) = 725.
		

References

  • Jejemae S. Maque, "Augmented Cubic Numbers," Undergraduate Thesis, Bukidnon State University, 2024.

Programs

  • Maple
    seq(7*n^3 - 6*n^2, n=1..20);
  • Mathematica
    Table[7 n^3 - 6 n^2, {n, 1, 20}]
  • Python
    [7*n**3 - 6*n**2 for n in range(1, 21)]

Formula

a(n) = 7*n^3 - 6*n^2.
G.f.: x*(1 + 28*x + 13*x^2) / (1-x)^4.

A383887 Smallest non-palindromic number that is congruent to its reverse mod n.

Original entry on oeis.org

10, 13, 10, 15, 16, 13, 18, 19, 10, 1011, 100, 15, 1017, 1027, 16, 1025, 1039, 13, 1048, 1021, 18, 103, 1026, 19, 1026, 1017, 14, 1033, 1013, 1011, 1068, 1049, 100, 1039, 1046, 15, 1000, 1055, 1017, 1041, 1066, 1027, 1048, 105, 16, 1077, 1032, 1025, 1014, 1051, 1039, 1017, 1103, 17, 106, 1065
Offset: 1

Author

Erick B. Wong, May 29 2025, at the suggestion of Lanny Wong

Keywords

Comments

Comparable to A070837, but such a number provably exists: if n is coprime to 10 then take 10^k where k is the order of 10 mod n; else take a>b>0 such that n divides 10^a - 10^b, then the number 10^(a+b) + 10^b + 1 works.
The n-th term in this sequence is equal to the first nonzero term of A070837 that occurs at an index divisible by n/gcd(n,9).

Examples

			For n=6, a(6)=13 is congruent to 31 mod 6.
For n=10, note that any number of 3 or fewer digits is necessarily a palindrome if the first digit equals the last, and 1011 is the first 4-digit non-palindrome.
		

Crossrefs

Programs

  • Mathematica
    seq[len_] := Module[{s = Table[0, {len}], c = 0, k = 9, d}, While[c < len, k++; krev = IntegerReverse[k]; If[k != krev, d = Select[Divisors[Abs[k - krev]], # <= len &]; Do[If[s[[d[[i]]]] == 0, s[[d[[i]]]] = k; c++], {i, 1, Length[d]}]]]; s]; seq[60] (* Amiram Eldar, May 31 2025 *)
  • PARI
    a(n) = my(k=1, d=digits(k), rd=Vecrev(d)); while(!((d != rd) && Mod(fromdigits(rd), n) == k), k++; d=digits(k); rd=Vecrev(d)); k; \\ Michel Marcus, May 30 2025
  • Python
    from functools import partial
    from itertools import count
    def accept(mod, k):
        r = int(str(k)[::-1])
        return r != k and (r-k) % mod == 0
    def a(n):
        return next(filter(partial(accept, n), count(10)))
    print([a(n) for n in range(1,57)])
    

A379607 Denominators corresponding to A379606.

Original entry on oeis.org

1, 60, 1400, 25200, 17248000, 7207200000, 12713500800000, 38118080000000, 252957982717440000000, 177399104762880000000, 39217856135377920000000000, 314173814535060480000000000, 566078379029271972864000000000000, 8188688361066909696000000000000, 3391339339748110516021960704000000000000
Offset: 0

Author

Robert B Fowler, Dec 27 2024

Keywords

Crossrefs

Cf. A379606 (numerators).

Programs

  • Mathematica
    Denominator[CoefficientList[InverseSeries[Series[Surd[(6*(x - Sin[x])), 3], {x, 0, 40}]], x][[2 ;; -2 ;; 2]]] (* Amiram Eldar, Dec 27 2024 *)

Extensions

Edited by N. J. A. Sloane, Jan 14 2025

A379606 S = (A-sin(A))/2 gives the area of a segment of the unit circle in terms of the arc length A (<= Pi). Expressing A in terms of S we get A = Sum_{n>=0} b^(2n+1)*c(n) where b = (12*S)^(1/3). Sequence gives numerators of c(n).

Original entry on oeis.org

1, 1, 1, 1, 43, 1213, 151439, 33227, 16542537833, 887278009, 15233801224559, 9597171184603, 1374085664813273149, 1593410154419351, 53299328587804322691259, 1065024810026227256263721, 11374760871959174491194191, 70563256104582737796094772987, 657272463951301325116190773432261
Offset: 0

Author

Robert B Fowler, Dec 27 2024

Keywords

Examples

			 A = b + b^3/60 + b^5/1400 + b^7/25200 + ..., where b = (12*S)^(1/3); the c(n) are 1, 1/60, 1/1400, 1/25200, 43/17248000, 1213/7207200000, ...
		

Crossrefs

Cf. A379607 (denominators).

Programs

  • Mathematica
    Numerator[CoefficientList[InverseSeries[Series[Surd[(6*(x - Sin[x])), 3], {x, 0, 40}]], x][[2 ;; -2 ;; 2]]] (* Amiram Eldar, Dec 27 2024 *)

Extensions

Edited by N. J. A. Sloane, Jan 14 2025

A376076 A variant of the inventory sequence which only counts prime numbers and only allows the values in the sequence to be 0, 1, or a prime number.

Original entry on oeis.org

2, 2, 2, 3, 1, 3, 2, 3, 3, 3, 5, 1, 3, 5, 2, 5, 5, 3, 5, 7, 5, 1, 5, 7, 7, 3, 5, 7, 7, 5, 5, 7, 7, 7, 5, 7, 11, 7, 1, 5, 7, 11, 11, 3, 5, 7, 13, 11, 3, 1, 5, 7, 13, 13, 3, 3, 5, 11, 13, 13, 5, 5, 5, 11, 17, 13, 5, 5, 1, 5, 11, 19, 13, 7, 7, 1, 1, 5, 11, 19, 13, 7, 7, 1, 2, 5, 11, 23, 17, 7, 7, 2, 2, 1
Offset: 1

Author

Anthony B Lara, Sep 08 2024

Keywords

Comments

The sequence starts with the seed [2, 2].
Construction is similar to A347317 except using only prime numbers. Each row ends after counting the highest prime that has occurred in the sequence so far.
When the number of 2's, 3's, 5's, p's is not a prime number, the sequence outputs the prime number closest to but less than the actual count. See example below.
Allowing 0 and 1 in the series is necessary as some primes enter the series before earlier primes. For example, generate the sequence using the example provided below and note on row 47 where 61 appears before 59 in the sequence, approximately the 391st element of the sequence. The effect becomes very clear after generating about 110 rows of data and only gets greater from there, given the overall tendency for increasing gaps between prime numbers.
Related sequences could be generated using different seed strings. Interestingly starting with the seed [3, 3] produces an irregular triangle of similar shape to [2, 2]. This does not seem to occur with 5, 5.
Testing further pairs of primes [p,p] as seeds reveals a subsequence of primes 11,17,29,41,59,71,101,107... that all form a similarly shaped irregular triangle after a trivial amount of 'count up' rows. This can be seen by comparing the row lengths of each pair of primes seed.
It appears that when any of these subsequence values are used as a pair of primes seed that sequence will never include any of the subsequence values. For example, using seed [11,11] the count of 2's skips values 11,17,29,41,59,71,101,107... The same is true if the seed [17,17], or any of the other subsequence values, are used.

Examples

			The sequence can be thought of as a row by row counting of prime occurrences with each column relating to a specific prime number, given the first two seed rows of 2 and 2.
As an irregular triangle this begins:
  Row1: 2 (seed)
  Row2: 2 (seed)
  Row3: 2
  Row4: 3 1
  Row5: 3 2
  Row6: 3 3
  Row7: 3 5 1
  Row8: 3 5 2
  Row9: 5 5 3
Note in Row8 how the number of 3's that have occurred so far is actually 6, but the rules of the sequence dictate outputting the nearest prime less than the count which is 5.
		

Crossrefs

Cf. A347317.

Programs

  • Python
    from itertools import islice
    from collections import Counter
    from sympy import isprime, nextprime, prevprime
    def agen(verbose=False): # generator of terms; verbose=True prints rows
        seed, bigp = [2, 2], 2
        c = Counter(seed)
        yield from seed
        if verbose: [print(k, end=",\n") for k in seed]
        while True:
            p = 2
            while p <= bigp:
                cp = c[p]
                if cp > 2 and not isprime(cp): cp = prevprime(cp)
                if cp > bigp: bigp = cp
                yield cp
                if verbose: print(cp, end=", ")
                c[cp] += 1
                p = nextprime(p)
            if verbose: print()
    print(list(islice(agen(), 94))) # Michael S. Branicky, Sep 10 2024

A375862 Number of caesium clock "ticks" in time units: tick, second, minute, hour, day, week, month, year, decade, century, millennium, eon (in Julian years).

Original entry on oeis.org

1, 9192631770, 551557906200, 33093474372000, 794243384928000, 5559703694496000, 24174783028746000, 290097396344952000, 2900973963449520000, 29009739634495200000, 290097396344952000000, 290097396344952000000000000
Offset: 1

Author

Robert B Fowler, Aug 31 2024

Keywords

Comments

The standard SI second has been defined since 1968 as 9192631770 (A230458) transitions ("ticks") of the caesium-133 atom.
The values of a(7) to a(12) are based on the average Julian calendar year of 365.25 days, which appears frequently in astronomical publications, where it is usually called simply "Julian years".

Crossrefs

Cf. A053401, A375666 (similar sequences based on units of seconds).
Cf. A213612, A213613, A213614 (use seconds in year).
Cf. A230458 (value of a(2)).

Formula

a(n) = A375666(n-1) * 9192631770, n>1.

A375666 Number of seconds in time units: second, minute, hour, day, week, month, year, decade, century, millennium, eon (in Julian years).

Original entry on oeis.org

1, 60, 3600, 86400, 604800, 2629800, 31557600, 315576000, 3155760000, 31557600000, 31557600000000000
Offset: 1

Author

Robert B Fowler, Aug 23 2024

Keywords

Comments

The last six numbers are based on the average Julian calendar year of 365.25 days, which appears frequently in astronomical publications, where it is usually called simply "Julian years".

Crossrefs

Cf. A053401 (with Gregorian years of 365.2425 days).
Cf. A213612, A213613, A213614 (uses a(7)).

A375027 Number of occurrences of Easter Sunday on March 22, March 23, ..., April 25 during a 532-year Julian Easter cycle.

Original entry on oeis.org

4, 8, 8, 12, 16, 16, 20, 16, 16, 20, 16, 16, 20, 16, 20, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 20, 16, 16, 20, 16, 12, 12, 8, 8, 4
Offset: 1

Author

Robert B Fowler, Jul 28 2024

Keywords

Comments

During any 532-year range of the Julian Calendar, each of the 35 possible dates for Easter Sunday occurs either 4, 8, 12, 16, or 20 times. This cycle is much simpler than the Gregorian Easter cycle (A224110).

Crossrefs

Cf. A224110 (frequencies for Gregorian Easter Sunday dates).
Cf. A348924 (algorithms for Paschal Full Moon and Easter Sunday in both Julian and Gregorian Calendars).
Cf. A349710 (algorithms for Paschal Full Moon and Easter Sunday in Julian Calendar).

Formula

Use the Julian Easter algorithm in A348924 for years 1 to 532 (or any range of 532 years), and tally the occurrence of each Easter date between March 22 and April 25.

A370821 Number of minimal deterministic Mealy automata with n states outputting ternary strings.

Original entry on oeis.org

3, 12, 54, 210, 798, 2850, 10038, 34410, 116406, 388362, 1283430, 4203786, 13675038, 44211570, 142202574, 455299242, 1451997726, 4614253122, 14617620726, 46177325994, 145505603694, 457437342546, 1435074324006, 4493508791754, 14045385985902
Offset: 1

Author

Lucas B. Vieira, Mar 02 2024

Keywords

Comments

a(n) counts the minimal number of ternary words w = uv, with |w| = n, such that u is an irreducible prefix and v a primitive word. This defines a minimal "pattern", written as "u(v)", describing the behavior of a minimal n-state deterministic Mealy automaton outputting a string from a ternary alphabet, where u is the transient output, and v the cyclic output, possibly truncated. Used in the definition of the Deterministic Complexity (DC) of strings (Vieira and Budroni, 2022).

Examples

			a(1) = 3 as there are only 3 deterministic Mealy automata with 1 state producing ternary words, corresponding to the 3 patterns (0), (1) and (2), generating the strings w=0^L, w=1^L, and w=2^L for L >= 1.
a(2) = 12, since there are 12 minimal ternary patterns: (01), 0(1), (02), 0(2), (10), 1(0), (12), 1(2), (20), 2(0), (21), 2(1).
E.g.: The ternary string w = 000120120 can be described by the pattern 00(012), where the parentheses indicate the repeating part, up to truncation. This pattern is minimal, with 5 symbols (ignoring the parentheses). It describes the behavior of a minimal deterministic Mealy automaton producing the string w, leading to its Deterministic Complexity (DC) to be DC(w) = 5.
		

References

  • M. Domaratzki, D. Kisman, and J. Shallit, On the number of distinct languages accepted by finite automata with n states, J. Autom. Lang. Combinat. 7 (2002) 4-18, Section 6, f_1(n).

Crossrefs

Cf. A059412 for the case of binary strings.
Cf. A143324 for psi(k,n).

Programs

  • Mathematica
    NumPrimitiveWords[k_, n_] := Sum[MoebiusMu[d] k^(n/d), {d, Divisors[n]}];
    a[n_] := NumPrimitiveWords[3, n] + Sum[(3 - 1) 3^(i - 1) NumPrimitiveWords[3, n - i], {i, 1, n - 1}]

Formula

a(n) = psi(3, n) + Sum_{i=1..n-1} (3-1)*3^(i-1)*psi(3, n-i), where psi(k,n) is the number of primitive words of length n on a k-letter alphabet (Cf. A143324).