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

A014842 Difference between A014837 and A014841.

Original entry on oeis.org

2, 0, 5, 2, 9, 3, 7, 6, 15, 2, 21, 14, 19, 9, 25, 7, 31, 12, 27, 28, 42, 10, 38, 34, 35, 22, 55, 16, 59, 27, 49, 48, 54, 10, 71, 52, 61, 30, 82, 34, 88, 56, 66, 75, 103, 27, 88, 59, 84, 64, 112, 46, 97, 56, 105, 96, 130, 28, 138, 114, 108, 70, 118, 66, 146, 94, 121, 86
Offset: 3

Views

Author

Keywords

A356961 Integers k such that A014841(k) = A014841(k+1).

Original entry on oeis.org

8, 16, 64, 104, 3954, 4146, 7374, 9294, 28035, 35166, 37218, 38154, 39318, 40578, 42308, 42774, 48748, 50214, 67638, 68106, 75918, 78882, 87294, 87836, 89382, 90642, 94074, 96124, 102822, 107324, 108294, 108534, 118016, 118806, 131046, 153798, 157254, 163182, 166494, 168486
Offset: 1

Views

Author

Michel Marcus, Sep 06 2022

Keywords

Crossrefs

Cf. A014841.

Programs

  • Mathematica
    f[n_]:=Sum[Mod[Total[IntegerDigits[n, i]], i], {i, 2, n-1}]; kmax=97000; a={}; For[k=3, k<=kmax, k++, If[f[k]==f[k+1], AppendTo[a,k]]]; a (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    f(n) = sum(b=2, n-1, sumdigits(n, b) % b); \\ A014841
    isok(k) = f(k) == f(k+1);
    
  • Python
    from sympy.ntheory import digits
    from itertools import count, islice
    def f(n): return sum(sum(digits(n, b)[1:])%b for b in range(2, n))
    def agen(): # generator of terms
        f0, f1 = f(3), f(4)
        for k in count(3):
            if f0 == f1: yield k
            f0, f1, = f1, f(k+2)
    print(list(islice(agen(), 4))) # Michael S. Branicky, Sep 06 2022

A014840 Sum of all the digits of n in every base prime to n from 2 to n-1.

Original entry on oeis.org

2, 2, 7, 2, 15, 10, 15, 8, 34, 12, 45, 22, 31, 32, 73, 28, 90, 40, 57, 50, 135, 46, 118, 74, 117, 70, 198, 58, 222, 120, 139, 122, 192, 92, 296, 152, 216, 136, 372, 112, 408, 202, 235, 208, 497, 176, 442, 224, 338, 260, 607, 202, 454, 276, 416, 330, 755, 194, 776
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local b;
     add(convert(convert(n,base,b),`+`), b = select(t -> igcd(t,n)=1, [$2..n-1]))
    end proc:
    map(f, [$3..100]); # Robert Israel, Nov 08 2024
  • Mathematica
    Table[Sum[If[CoprimeQ[i, n], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 61}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; for (i=2, n-1, if (gcd(i, n) == 1, d = digits(n, i); s += sum(j=1, #d, d[j]););); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from math import gcd
    from sympy.ntheory import digits
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if gcd(b, n) == 1)
    print([a(n) for n in range(3, 62)]) # Michael S. Branicky, Sep 06 2022

A014838 Sum of all the digits of n in every prime base from 2 to n-1.

Original entry on oeis.org

2, 3, 5, 6, 9, 11, 11, 10, 14, 16, 21, 21, 21, 23, 29, 32, 39, 42, 42, 39, 47, 52, 53, 49, 52, 53, 62, 66, 76, 83, 82, 76, 77, 82, 93, 87, 85, 90, 102, 107, 120, 123, 129, 120, 134, 144, 147, 153, 150, 151, 166, 176, 178, 185, 181, 168, 184, 194, 211, 199, 207
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[If[PrimeQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}],{n, 3, 63}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; forprime (i=2, n-1, d = digits(n, i); s += sum(j=1, #d, d[j]);); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from sympy.ntheory import digits, isprime
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if isprime(b))
    print([a(n) for n in range(3, 64)]) # Michael S. Branicky, Sep 06 2022

A014839 Sum of all the digits of n in every prime-power base from 2 to n-1.

Original entry on oeis.org

2, 3, 7, 9, 13, 13, 16, 19, 26, 28, 36, 39, 42, 34, 45, 44, 55, 59, 63, 64, 76, 75, 80, 82, 82, 87, 102, 112, 128, 113, 120, 121, 129, 130, 148, 149, 154, 156, 175, 187, 207, 214, 219, 217, 238, 227, 237, 228, 233, 239, 262, 246, 256, 261, 265, 260, 284, 299
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[If[PrimePowerQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 60}] (* Stefano Spezia, Sep 06 2022 *)
Showing 1-5 of 5 results.