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.

A381217 a(n) is the least positive k such that the sum of the reverses of the first k primes is divisible by n.

Original entry on oeis.org

1, 1, 10, 5, 2, 16, 5, 20, 20, 3, 9, 16, 7, 5, 10, 30, 4, 20, 68, 44, 16, 20, 9, 20, 19, 7, 26, 5, 47, 34, 19, 30, 20, 28, 99, 20, 29, 68, 54, 44, 86, 16, 41, 20, 74, 26, 40, 30, 16, 50, 28, 82, 97, 26, 101, 51, 68, 47, 6, 44, 38, 53, 42, 30, 7, 20, 38, 28, 10, 99, 110, 20, 72, 121, 103, 137, 189
Offset: 1

Views

Author

Robert Israel, Feb 17 2025

Keywords

Comments

a(n) is the least k such that A071602(k) is divisible by n.

Examples

			a(3) = 10 because A071602(10) =  2 + 3 + 5 + 7 + 11 + 31 + 71 + 91 + 32 + 92 = 345 is divisible by 3, and no earlier term of A071602 is divisible by 3.
		

Crossrefs

Cf. A071602.

Programs

  • Maple
    N:= 100: # for a(1) .. a(N)
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    V:= Vector(N):
    Cands:= {$1..N}:
    p:= 0: s:= 0:
    for i from 1 while Cands <> {} do
      p:= nextprime(p); s:= s + rev(p);
    S:= select(t -> s mod t = 0, Cands);
    if S <> {} then
       V[convert(S,list)]:= i;
       Cands:= Cands minus S
    fi
    od:
    convert(V,list);
  • Mathematica
    s={};Do[ k=1;sm=0;Until[Divisible[sm,n],sm=sm+IntegerReverse[Prime[k]];k++];AppendTo[s,k-1],{n,77}];s (* James C. McMahon, Feb 19 2025 *)
  • PARI
    sumkrp(k) = my(v=primes(k)); sum(i=1, k, fromdigits(Vecrev(digits(v[i])))); \\ A071602
    a(n) = my(k=1); while(sumkrp(k) % n, k++); k; \\ Michel Marcus, Feb 17 2025

A381245 Numbers that are partial sums of the reverses of the sequence of primes and are reverses of primes.

Original entry on oeis.org

2, 5, 17, 358, 775, 3145, 7813, 10277, 13978, 15232, 19478, 32324, 36056, 70042, 71396, 72893, 76856, 102374, 141982, 155585, 301291, 331357, 332588, 354643, 717817, 763586, 791641, 799532, 922981, 931705, 935117, 940241, 952975, 993551, 1020461, 1028383, 1060075, 1094099, 1126831, 1145257
Offset: 1

Views

Author

Robert Israel, Feb 17 2025

Keywords

Comments

Intersection of A071602 (in that order) and A004087.

Examples

			a(4) = 358 is a term because 358 = A071602(11) is the sum of the reverses of the first 11 primes, and is the reverse of the prime 853.
A071602(7) = 130 is not a term, because 130 is not the reverse of a prime, even though the reverse of 130 is a prime.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    PR:= map(rev, select(isprime, [$1..10000]):
    SPR:= ListTools:-PartialSums(PR):
    select(t -> t mod 10 <> 0 and isprime(rev(t)),SPR);
Showing 1-2 of 2 results.