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

A070635 a(n) = n mod (sum of digits of n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 13 2002

Keywords

Crossrefs

Cf. A007953.
Cf. A199238.

Programs

Formula

a(A005349(n)) = 0. - Reinhard Zumkeller, Mar 10 2008
A188641(n) = A000007(a(n)); a(A065877(n)) > 0. - Reinhard Zumkeller, Apr 07 2011
a(A138791(n)) = n and a(m) <> n for m < A138791(n). - Reinhard Zumkeller, Nov 07 2011

A136251 a(n) = n-th prime reduced modulo the sum of its digits.

Original entry on oeis.org

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

Views

Author

Odimar Fabeny, Mar 17 2008

Keywords

Comments

First occurrence of k: A138792. - Robert G. Wilson v, Mar 27 2008

Examples

			2 = 2*1 + 0
3 = 3*1 + 0
5 = 5*1 + 0
7 = 7*1 + 0
11 = 2*5 + 1 (the sum of the digits of 11 is equal to 2)
13 = 4*3 + 1
17 = 8*2 + 1
19 = 10*1 + 9
		

Crossrefs

Programs

  • Maple
    P := select(isprime, [2,seq(i,i=3..10^3,2)]):
    map(p -> p mod convert(convert(p,base,10),`+`), P); # Robert Israel, Mar 05 2024
  • Mathematica
    f[n_] := Block[{p = Prime@n}, Mod[p, Plus @@ IntegerDigits@p]]; Array[f, 97] (* Robert G. Wilson v, Mar 27 2008 *)
  • PARI
    a(n) = my(p=prime(n)); p % sumdigits(p); \\ Michel Marcus, Mar 07 2023

Formula

a(n) = A070635(A000040(n)). - Michel Marcus, Mar 07 2023

Extensions

More terms from Robert G. Wilson v, Mar 27 2008

A138792 Least prime, p, such that p mod (sum of the digits of p) = n.

Original entry on oeis.org

2, 11, 67, 23, 89, 53, 83, 29, 173, 19, 197, 193, 337, 167, 269, 79, 757, 397, 379, 479, 3677, 769, 997, 6967, 1699, 3889, 9857, 7867, 6959, 9949, 16987, 9887, 49697, 47599, 18899, 67979, 73999, 56999, 197699, 49999, 159899, 189989, 98899, 98999, 988877
Offset: 0

Views

Author

Robert G. Wilson v, Mar 28 2008

Keywords

Comments

First occurrence of n in A136251.

Examples

			a(2) = 67 = 13*5+2 <--> 67 (mod 13) = 2.
		

Crossrefs

Programs

  • Maple
    V:= Array(0..50): count:= 0: p:= 1:
    while count < 51 do
      p:= nextprime(p);
      s:= convert(convert(p,base,10),`+`);
      v:= p mod s;
      if v <= 50 and V[v] = 0 then V[v]:= p; count:= count+1;  fi
    od:
    convert(V,list); # Robert Israel, Mar 07 2023
  • Mathematica
    f[n_] := Block[{p = Prime@ n}, Mod[p, Plus @@ IntegerDigits@ p]]; t = Table[0, {1000}]; Do[ a = f@n; If[a < 1000 && t[[a + 1]] == 0, t[[a + 1]] = Prime@ n; Print[{a, Prime@n}]], {n, 503200000}]
    lp[n_]:=Module[{p=2},While[Mod[p,Total[IntegerDigits[p]]]!=n,p= NextPrime[ p]];p]; Array[lp,50,0] (* Harvey P. Dale, Jan 15 2019 *)
  • PARI
    a(n) = my(p=2); while ((p % sumdigits(p)) != n, p=nextprime(p+1)); p; \\ Michel Marcus, Mar 07 2023
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        adict, n, p = dict(), 0, 2
        while True:
            v = p%sum(map(int, str(p)))
            if v not in adict: adict[v] = p
            while n in adict: yield adict[n]; n += 1
            p = nextprime(p)
    print(list(islice(agen(), 45))) # Michael S. Branicky, Mar 07 2023

Extensions

Name corrected by Robert Israel, Mar 07 2023

A199262 Smallest m such that A199238(m) = n.

Original entry on oeis.org

1, 3, 11, 15, 59, 95, 223, 255, 1007, 1919, 4091, 6143, 16379, 28671, 61439, 65535, 261119, 516095, 1048571, 1966079, 4128767, 8380415, 16769023, 25165823, 67108799, 134184959, 268434431, 469762047, 1073741819, 2013265919, 4160749567, 4294967295, 17163091967
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 04 2011

Keywords

Comments

A199238(a(n)) = n and A199238(m) <> n for m < a(n).

Crossrefs

Cf. A138791.

Programs

  • Haskell
    a199262 n = (fromJust $ elemIndex n a199238_list) + 1

Extensions

a(24)-a(32) from Donovan Johnson, Nov 05 2011
Showing 1-4 of 4 results.