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.

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

This page as a plain text file.
%I A379138 #7 Dec 16 2024 02:15:38
%S A379138 0,4,10,504,25242,1110,28782,46764,46254,86058,50094,47874,107880,
%T A379138 108180,110100,108990,107070,109800,2726262,2830272,2698962,3029292,
%U A379138 2900982,2799972,2979792,3100002,2998992,4498944,4409034,4709064,4510044,4916184,4790874,4787874,4869684,4959594,4896984,4891884
%N A379138 a(n) is the first number that is the sum of two palindromic primes in exactly n ways.
%C A379138 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.
%e A379138 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.
%p A379138 digrev:= proc(n) local L,i;
%p A379138   L:= convert(n,base,10);
%p A379138   add(L[-i]*10^(i-1),i=1..nops(L))
%p A379138 end proc:
%p A379138 F:= proc(d) # d-digit odd palindromic primes, d >= 3
%p A379138   local R,x,rx,i;
%p A379138     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]))
%p A379138 end proc:
%p A379138 PP:= [3,5,7,11,op(F(3)),op(F(5)),op(F(7))]: nPP:= nops(PP):
%p A379138 V:= Vector(2*PP[-1],datatype=integer[1]):
%p A379138 for i from 1 to nPP do for j from 1 to i do
%p A379138    x:= PP[i]+PP[j];
%p A379138    V[x]:= V[x]+1
%p A379138 od od:
%p A379138 M:= max(V):
%p A379138 W:= Array(0..M,-1):
%p A379138 W[0]:= 0: W[1]:= 4:
%p A379138 for x from 1 to 2*PP[-1] do
%p A379138   if W[V[x]] = -1 then W[V[x]]:= x fi
%p A379138 od:
%p A379138 convert(W,list); # entries of -1 indicate values > 10^8
%Y A379138 Cf. A002385, A377848.
%K A379138 nonn
%O A379138 0,2
%A A379138 _Robert Israel_, Dec 15 2024