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

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

A138791 Least number k such that A070635(k) = n.

Original entry on oeis.org

1, 11, 16, 15, 14, 38, 34, 29, 28, 19, 49, 76, 68, 98, 269, 79, 458, 397, 379, 299, 779, 769, 689, 898, 799, 3889, 4898, 5599, 6698, 7996, 8798, 9599, 19888, 16999, 18899, 67979, 58898, 39899, 59998, 49999, 89789, 189989, 89998, 98999, 489898, 298999
Offset: 0

Views

Author

Robert G. Wilson v, Mar 29 2008

Keywords

Comments

A070635(a(n)) = n and A070635(m) <> n for m < a(n).
Least k such that k mod A007953(k) = n. - Robert Israel, Dec 29 2015

Examples

			a(2) = 16: 1+6 = 7 and 16 mod 7 = 2. - _Robert Israel_, Dec 30 2015
		

Crossrefs

Programs

  • Haskell
    a199263 n = (fromJust $ elemIndex n a070635_list) + 1
    -- Reinhard Zumkeller, Nov 07 2011
  • Maple
    extend:= proc(d, x, sx)
    global A, nmin;
    local y, n, tmax;
    if d = 0 then
        n:= x mod sx;
        if not assigned(A[n]) then
           A[n]:= x;
           if n = nmin then
             for nmin from n while assigned(A[nmin]) do od:
           fi;
        fi
    else
      tmax:= 9*d + sx;
      if nmin >= tmax then return fi;
      for y from max(0, nmin + 10 - tmax) to 9 do
        procname(d-1,10*x+y,sx+y)
      od:
    fi
    end proc:
    A[0]:= 1:
    nmin:= 1:
    for d from 2 while nmin < 101 do
       extend(d,0,0)
    od:
    seq(A[i],i=0..nmin-1); # Robert Israel, Dec 29 2015
  • Mathematica
    t = Table[0, {100}]; Do[ a = Mod[n, Plus @@ IntegerDigits@n]; If[a < 100 && t[[a + 1]] == 0, t[[a + 1]] = n; Print[{a, n}]], {n, 2^31}]
    lnk[n_]:=Module[{k=1},While[Mod[k,Total[IntegerDigits[k]]]!=n,k++];k]; Array[lnk, 50, 0] (* Harvey P. Dale, Oct 11 2014 *)

Extensions

Definition corrected by Robert Israel, Dec 29 2015
Showing 1-2 of 2 results.