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.

A343496 First point of the straight lines in A340649.

This page as a plain text file.
%I A343496 #25 May 23 2021 03:08:43
%S A343496 5,31,194,1061,6456,40080,251721,1617206,10553419,69709769,465769825
%N A343496 First point of the straight lines in A340649.
%C A343496 prime(a(n)+1) - prime(a(n)) = n*2. E.g., for n=4: prime(a(4)+1) - prime(a(4)) = 4*2, prime(1062) - prime(1061) = 4*2, 8521 - 8513 = 8.
%H A343496 Simon Strandgaard, <a href="/A343496/a343496.png">Visualization of the first 5 terms</a>.
%F A343496 a(n) = smallest k that satisfies A001223(k) = 2*n and A340649(k) = A141042(k).
%e A343496 For n=1, consider k's with prime gap 1*2 = 2, i.e., k's such that A001223(k)=2. k=5 is the first place where A001223(k)=2 and A141042(k)=A340649(k), so a(1)=5.
%e A343496 For n=2, consider k's with prime gap 2*2 = 4, i.e., k's such that A001223(k)=4. k=31 is the first place where A001223(k)=4 and A141042(k)=A340649(k), so a(2)=31.
%e A343496 For n=3, consider k's with prime gap 3*2 = 6, i.e., k's such that A001223(k)=6. k=194 is the first place where A001223(k)=6 and A141042(k)=A340649(k), so a(3)=194.
%o A343496 (Ruby) n = 1
%o A343496 last_prime = 2
%o A343496 find_gap = 2
%o A343496 result = []
%o A343496 Prime.each(10_000) do |prime|
%o A343496     next if prime == 2
%o A343496     gap = prime - last_prime
%o A343496     if gap == find_gap
%o A343496         value = (n * prime) % last_prime
%o A343496         if value == n * gap
%o A343496             result << n
%o A343496             find_gap += 2
%o A343496         end
%o A343496     end
%o A343496     n += 1
%o A343496     last_prime = prime
%o A343496 end
%o A343496 p result
%Y A343496 Cf. A000040, A001223, A141042, A340649, A029707, A029709, A320701, A320702, A320703.
%K A343496 nonn,more
%O A343496 1,1
%A A343496 _Simon Strandgaard_ and _Jamie Morken_, Apr 17 2021