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.

A376699 Positions of primes in the sequence of numbers of the form 2^i * 3^j - 1 (A069353).

This page as a plain text file.
%I A376699 #19 Apr 26 2025 05:59:34
%S A376699 3,4,5,6,8,10,11,13,15,16,18,21,22,25,31,32,36,39,40,42,51,57,61,63,
%T A376699 65,66,71,73,79,82,94,97,106,107,110,120,121,127,128,129,130,138,142,
%U A376699 144,161,192,204,205,212,216,232,234,244,259,264,265,308,329,346,348
%N A376699 Positions of primes in the sequence of numbers of the form 2^i * 3^j - 1 (A069353).
%H A376699 Amiram Eldar, <a href="/A376699/b376699.txt">Table of n, a(n) for n = 1..10000</a>
%F A376699 A069353(a(n)) = A003586(a(n)) - 1 = A005105(n).
%t A376699 With[{lim = 10^10}, Position[Sort@ Flatten@ Table[2^i*3^j - 1, {i, 0, Log2[lim]}, {j, 0, Log[3, lim/2^i]}], _?PrimeQ] // Flatten]
%o A376699 (PARI) lista(lim) = {my(s = List()); for(i = 0, logint(lim, 2), for(j = 0, logint(lim >> i, 3), listput(s, 2^i * 3^j - 1))); s = Set(s); for(i = 1, #s, if(isprime(s[i]), print1(i, ", ")));}
%o A376699 (Python)
%o A376699 from itertools import count, islice
%o A376699 from sympy import isprime, integer_log
%o A376699 def A069353(n):
%o A376699     def bisection(f,kmin=0,kmax=1):
%o A376699         while f(kmax) > kmax: kmax <<= 1
%o A376699         kmin = kmax >> 1
%o A376699         while kmax-kmin > 1:
%o A376699             kmid = kmax+kmin>>1
%o A376699             if f(kmid) <= kmid:
%o A376699                 kmax = kmid
%o A376699             else:
%o A376699                 kmin = kmid
%o A376699         return kmax
%o A376699     def f(x): return n+x-sum(((x+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
%o A376699     return bisection(f,n-1,n-1)
%o A376699 def A376699_gen(): # generator of terms
%o A376699     return filter(lambda n:isprime(A069353(n)), count(1))
%o A376699 A376699_list = list(islice(A376699_gen(),30)) # _Chai Wah Wu_, Mar 31 2025
%Y A376699 Cf. A003586, A005105, A069353, A375906, A376700, A376701.
%K A376699 nonn
%O A376699 1,1
%A A376699 _Amiram Eldar_, Oct 02 2024