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.

A242541 Undulating primes: prime numbers whose digits follow the pattern A, B, A, B, A, B, A, B, ...

This page as a plain text file.
%I A242541 #33 Jun 09 2022 20:10:45
%S A242541 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,
%T A242541 97,101,131,151,181,191,313,353,373,383,727,757,787,797,919,929,18181,
%U A242541 32323,35353,72727,74747,78787,94949,95959,1212121,1616161,323232323
%N A242541 Undulating primes: prime numbers whose digits follow the pattern A, B, A, B, A, B, A, B, ...
%C A242541 All numbers in this sequence with three or more digits must have an odd number of digits. Any number with an even number of digits that follow this pattern is divisible by a number of the form 1010101...1010101 where the number of digits is one less than the number of digits in the original number.
%C A242541 Union of A004022 and A032758. - _Arkadiusz Wesolowski_, May 17 2014
%C A242541 Because A may equal B, 11 (and other prime repunits) are terms in this sequence (but not of A032758). - _Harvey P. Dale_, May 26 2015
%H A242541 Harvey P. Dale, <a href="/A242541/b242541.txt">Table of n, a(n) for n = 1..135</a>
%e A242541 121 = 11*11 is not prime and thus is not a term of this sequence.
%p A242541 select(isprime,[$0..99,seq(seq(seq(a*(10^(d+1)-10^(d+1 mod 2))/99 + b*(10^d - 10^(d mod 2))/99, b=0..9),a=1..9,2),d=3..9,2)]); # _Robert Israel_, Jul 08 2016
%t A242541 Select[Union[Flatten[Table[FromDigits[PadRight[{},n,#]],{n,9}]&/@ Tuples[ Range[0,9],2]]],PrimeQ] (* _Harvey P. Dale_, May 26 2015 *)
%o A242541 (Python)
%o A242541 from itertools import count, islice
%o A242541 from sympy import isprime, primerange
%o A242541 def agen(): # generator of terms
%o A242541     yield from primerange(2, 100)
%o A242541     yield from (t for t in (int((A+B)*d2+A) for d2 in count(1) for A in "1379" for B in "0123456789") if isprime(t))
%o A242541 print(list(islice(agen(), 51))) # _Michael S. Branicky_, Jun 09 2022
%Y A242541 Cf. A004022, A032758, A033619.
%K A242541 nonn,base
%O A242541 1,1
%A A242541 _J. Lowell_, May 17 2014