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

A379138 a(n) is the first number that is the sum of two palindromic primes in exactly n ways.

Original entry on oeis.org

0, 4, 10, 504, 25242, 1110, 28782, 46764, 46254, 86058, 50094, 47874, 107880, 108180, 110100, 108990, 107070, 109800, 2726262, 2830272, 2698962, 3029292, 2900982, 2799972, 2979792, 3100002, 2998992, 4498944, 4409034, 4709064, 4510044, 4916184, 4790874, 4787874, 4869684, 4959594, 4896984, 4891884
Offset: 0

Views

Author

Robert Israel, Dec 15 2024

Keywords

Comments

a(n) is the least k such that there are exactly n numbers j <= k/2 where both j and k - j are in A002385.

Examples

			a(5) = 1110 because 1110 = 181 + 929 = 191 + 919 = 313 + 797 = 353 + 757 = 383 + 727 is the sum of two palindromic primes in exactly 5 ways, and no smaller even number works.
		

Crossrefs

Programs

  • Maple
    digrev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    F:= proc(d) # d-digit odd palindromic primes, d >= 3
      local R,x,rx,i;
        select(isprime,map(t -> seq(10^((d+1)/2)*t + i*10^((d-1)/2) + digrev(t),i=0..9), [$(10^((d-3)/2)) .. 10^((d-1)/2)-1]))
    end proc:
    PP:= [3,5,7,11,op(F(3)),op(F(5)),op(F(7))]: nPP:= nops(PP):
    V:= Vector(2*PP[-1],datatype=integer[1]):
    for i from 1 to nPP do for j from 1 to i do
       x:= PP[i]+PP[j];
       V[x]:= V[x]+1
    od od:
    M:= max(V):
    W:= Array(0..M,-1):
    W[0]:= 0: W[1]:= 4:
    for x from 1 to 2*PP[-1] do
      if W[V[x]] = -1 then W[V[x]]:= x fi
    od:
    convert(W,list); # entries of -1 indicate values > 10^8
Showing 1-1 of 1 results.