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.

A308335 Palindromic primes such that sum of digits = number of digits.

This page as a plain text file.
%I A308335 #37 Nov 23 2019 04:08:08
%S A308335 11,10301,1201021,3001003,10000900001,10002520001,10013131001,
%T A308335 10111311101,10301110301,11012121011,11020302011,11030103011,
%U A308335 11100500111,11120102111,12000500021,12110101121,13100100131,30000500003,30011111003,1000027200001,1000051500001
%N A308335 Palindromic primes such that sum of digits = number of digits.
%C A308335 Every palindrome with an even number of digits is divisible by 11, so 11 is the only term of the sequence with an even number of digits.
%C A308335 Every palindrome with a number of digits which is a multiple of 3 also has a sum of digits which is divisible by 3, so there is no term with 3*k digits.
%C A308335 So, except 11 with 2 digits, the terms of this sequence must have a number of digits that belongs to A007310.
%C A308335 For n > 1, the middle digit of a(n) is odd. - _Chai Wah Wu_, Jun 30 2019
%H A308335 Chai Wah Wu, <a href="/A308335/b308335.txt">Table of n, a(n) for n = 1..10000</a>
%H A308335 G. L. Honaker, Jr. and Chris Caldwell, <a href="https://primes.utm.edu/curios/page.php?short=1201021"> Prime Curios!, 10201021</a>.
%e A308335 3001003 is a term because it is a palindromic prime that has 7 digits and its sum of its digits is 7.
%t A308335 f[n_] := If[n==2, {11}, If[Mod[(n-1) (n-5), 6]>0, {}, Block[{h = (n - 1)/2, L={}, p}, Do[p = Select[ Flatten[ Permutations /@ IntegerPartitions[ (n - c)/2, {h}, Range[0, 9]], 1], MemberQ[{1, 3, 7, 9}, Last[#]] &]; L = Join[L, Select[ FromDigits /@ (Flatten[{Reverse[#], c, #}] & /@ p), PrimeQ]], {c, 1, n-2, 2}]; Sort[L]]]]; Join @@ (f /@ Range[13]) (* _Giovanni Resta_, Jun 06 2019 *)
%o A308335 (PARI) isok(p) = isprime(p) && (d=digits(p)) && (Vecrev(d) == d) && (#d == vecsum(d)); \\ _Michel Marcus_, Jun 29 2019
%Y A308335 Intersection of A000040 (primes), A002113 (palindromes) and A061384 (sum of digits = number of digits).
%Y A308335 Intersection of A002385 and A061384.
%Y A308335 Intersection of A069710 and A002113.
%K A308335 nonn,base
%O A308335 1,1
%A A308335 _Bernard Schott_, May 20 2019
%E A308335 a(6)-a(21) from _Jon E. Schoenfield_, May 20 2019