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: Kaleb Williams

Kaleb Williams's wiki page.

Kaleb Williams has authored 4 sequences.

A380976 a(0) = 0, a(1) = 1. Thereafter, a(n) = a(n-1) + a(n-2) converted to base n, read in base n+1.

Original entry on oeis.org

0, 1, 1, 2, 3, 6, 10, 18, 31, 54, 93, 172, 300, 536, 955, 1686, 2976, 5224, 9491, 17089, 30618, 54774, 97553, 172749, 305164, 554749, 982005, 1757750, 3140769, 5584153, 9924579, 17582197, 31100841, 56191241, 99509416, 177595495, 316647651, 564436376, 1002970166
Offset: 0

Author

Kaleb Williams, Feb 10 2025

Keywords

Examples

			a(5) = a(4) + a(3) = 5 = 10_5 -> 10_6 = 6.
a(13) = a(12) + a(11) = 472 = 2A4_13 -> 2A4_14 = 536.
		

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, (l-> add(l[i]*
         (n+1)^(i-1), i=1..nops(l)))(convert(a(n-1)+a(n-2), base, n)))
        end:
    seq(a(n), n=0..43);  # Alois P. Heinz, Feb 12 2025
  • Mathematica
    A380976[n_] := A380976[n] = If[n <= 1, n, FromDigits[IntegerDigits[A380976[n-1] + A380976[n-2], n], n+1]];
    Array[A380976, 50, 0] (* Paolo Xausa, Feb 14 2025 *)
  • Python
    from itertools import count, islice
    from sympy.ntheory.digits import digits
    def fromdigits(digs, base): return sum(d*base**i for i, d in enumerate(digs[::-1]))
    def agen(): # generator of terms
        yield from (a := [0, 1])
        for n in count(2):
            yield (an := fromdigits(digits(a[-2] + a[-1], n)[1:], n+1))
            a = [a[-1], an]
    print(list(islice(agen(), 37))) # Michael S. Branicky, Feb 11 2025

A375087 Numbers added to cumulative correction term in order for prime numbers to resemble a recursive sequence.

Original entry on oeis.org

0, 1, 0, 4, 2, 4, 2, 0, 8, 2, 4, 8, 2, 0, 4, 10, 2, 4, 8, 0, 4, 4, 2, 10, 10, 2, 4, 2, -8, 14, 12, 8, -2, 10, 6, 2, 8, 4, 4, 10, -2, 10, 8, 4, -6, 2, 20, 14, 2, 0, 8, -2, 6, 10, 6, 10, 2, 4, 8, -4, -2, 20, 16, 2, -8, 12, 10, 14, 8, 0, 2, 8, 8, 8, 4, 2, 10, 4, 2, 16, 2, 10
Offset: 1

Author

Kaleb Williams, Jul 29 2024

Keywords

Comments

At n=1, prime(n+2) = prime(n+1) + prime(n) but thereafter such a form must be reduced by a "correction" amount prime(n+2) = prime(n+1) + prime(n) - A096379(n), and the present sequence is how that correction changes.

Examples

			For n = 1: a(1) = p_2 + p_1 - p_3 - (Sum_{i <= 0} a(i)) = p_2 + p_1 - p_3 ==> a(1) = 3 + 2 - 5 = 0 ==> a(1) = 0.
For n = 2: a(2) = p_3 + p_2 - p_4 - (Sum_{i <= 1} a(i)) = p_3 + p_2 - p_4 - a(1) ==> a(2) = 5 + 3 - 7 - 0 = 1 ==> a(2) = 1.
For n = 3: a(3) = p_4 + p_3 - p_5 - (Sum_{i <= 2} a(i)) = p_4 + p_3 - p_5 - (a(1) + a(2)) ==> a(3) = 7 + 5 - 11 - (0 + 1) = 0 ==> a(3) = 0.
		

Crossrefs

Cf. A096379 (partial sums), A066495 (indices of 0's).

Programs

  • PARI
    lista(nn) = my(va = vector(nn)); for (n=1, nn, va[n] = prime(n+1) + prime(n) - prime(n+2) - sum(i=1, n-1, va[i]);); va; \\ Michel Marcus, Jul 30 2024

Formula

a(n) = 2*prime(n+1) - prime(n+2) - prime(n-1), for n>=2.
a(n) = A096379(n) - A096379(n-1), for n>=2.
prime(n+2) = prime(n+1) + prime(n) - Sum_{i=1..n} a(i)
a(n) = prime(n+1) + prime(n) - prime(n+2) - Sum_{i=0..n-1} a(i).

A374610 Smallest result of n in "base-p" using digits 0,1,2 and interpreted as base-3.

Original entry on oeis.org

1, 3, 2, 4, 6, 5, 7, 11, 8, 15, 14, 16, 20, 17, 24, 23, 25, 41, 26, 47, 44, 51, 50, 52, 68, 53, 74, 71, 78, 77, 79, 125, 80, 131, 133, 149, 134, 155, 152, 159, 158, 160, 206, 161, 212, 214, 230, 215, 236, 233, 240, 239, 241, 401, 242, 449, 404, 455, 457, 473
Offset: 2

Author

Kaleb Williams, Jul 13 2024

Keywords

Comments

A "base-p" representation of n is n = Sum_{i} d_i * prime(i+1) with i >= 0 and with "digits" 0 <= d_i <= 2.
Among possible representations, a(n) is the smallest a(n) = Sum_{i} d_i * 3^i.
The effect is to the lazy representation of n as the sum of up to 2 of each prime, with lazy meaning work from largest to smallest prime and use the fewest of each as long as smaller primes will be sufficient to complete the sum.

Examples

			For n = 3, 3 = 1*3 + 0*2 = 10_p => 10_3 = 1*3 + 0*1 = 3_10 = a(3).
For n = 5, 5 = 1*3 + 1*2 = 11_p => 11_3 = 1*3 + 1*1 = 4_10 = a(5).
For n = 19, 19 = 1*7 + 1*5 + 1*3 + 2*2 = 1112_p => 1112_3 = 1*27 + 1*9 + 1*3 + 2*1 = 41_10 = a(19).
		

A374490 Greatest common divisor of sums of n consecutive cubes.

Original entry on oeis.org

1, 1, 9, 4, 5, 9, 7, 8, 27, 5, 11, 36, 13, 7, 45, 16, 17, 27, 19, 20, 63, 11, 23, 72, 25, 13, 81, 28, 29, 45, 31, 32, 99, 17, 35, 108, 37, 19, 117, 40, 41, 63, 43, 44, 135, 23, 47, 144, 49, 25, 153, 52, 53, 81, 55, 56, 171, 29, 59, 180, 61
Offset: 1

Author

Kaleb Williams, Jul 09 2024

Keywords

Comments

A quasipolynomial of order 12 and degree 2. - Charles R Greathouse IV, Jul 11 2024

Examples

			For n=3, the sum of 3 consecutive cubes is S(x) = x^3 + (x+1)^3 + (x+2)^3 which has S(0) = 9 and thereafter remains a multiple of 9 since S(x) - S(x-1) = 9*(x^2 + x + 1), so that the GCD of all S(x) is a(3) = 9.
		

Crossrefs

Cf. A026741 (for consecutive integers), A060789 (for consecutive squares).
Cf. A359380.

Programs

  • PARI
    f(n,x='x)=n*x^3 + (3/2*n^2 - 3/2*n)*x^2 + (n^3 - 3/2*n^2 + 1/2*n)*x + (1/4*n^4 - 1/2*n^3 + 1/4*n^2)
    Polya(P)=my(x=variable(P),D=poldegree(P),f=D!,t=0); forstep(d=D,0,-1, my(c=polcoef(P,d,x)*d!); P-=c*binomial(x,d); t=gcd(t,c); f/=max(d,1)); t
    a(n)=Polya(f(n)) \\ Charles R Greathouse IV, Jul 09 2024

Formula

From Stefano Spezia, Jul 10 2024: (Start)
G.f.: x*(1 + x + 9*x^2 + 4*x^3 + 5*x^4 + 9*x^5 + 7*x^6 + 8*x^7 + 27*x^8 + 5*x^9 + 11*x^10 + 36*x^11 + 11*x^12 + 5*x^13 + 27*x^14 + 8*x^15 + 7*x^16 + 9*x^17 + 5*x^18 + 4*x^19 + 9*x^20 + x^21 + x^22)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2*(1 - x + x^2)^2*(1 + x + x^2)^2*(1 - x^2 + x^4)^2).
a(A359380(n)) = A359380(n). (End)
a(n) = n/2 if n is 2 or 10 mod 12; a(n) = 3n if n is 0, 3, or 9 mod 12; a(n) = 3n/2 if n = 6 mod 12; and a(n) = n otherwise (if n is 1, 4, 5, 7, 8, or 11 mod 12). In particular, n/2 <= a(n) <= 3n. - Charles R Greathouse IV, Jul 11 2024

Extensions

a(41)-a(61) from Charles R Greathouse IV, Jul 09 2024