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.

A354368 Successive pairs of terms (a, b) such that (a + b) is a square and at least one of a and b is a prime number. This is the lexicographically earliest infinite sequence of distinct terms > 0 with this property.

This page as a plain text file.
%I A354368 #20 Jul 01 2025 08:58:07
%S A354368 2,7,3,13,5,11,17,19,23,41,29,71,31,113,37,107,43,101,47,53,59,137,61,
%T A354368 83,67,257,73,251,79,821,89,167,97,227,103,797,109,467,127,197,131,
%U A354368 193,139,761,149,751,151,173,157,419,163,1601,179,397,181,719,191,293,199,701,211,1553,223,353,229,347
%N A354368 Successive pairs of terms (a, b) such that (a + b) is a square and at least one of a and b is a prime number. This is the lexicographically earliest infinite sequence of distinct terms > 0 with this property.
%C A354368 This sequence is a permutation of the prime numbers.
%H A354368 Michael De Vlieger, <a href="/A354368/a354368.png">Annotated log-log scatterplot of a(n)</a>, n = 1..10^4, showing records in red, local minima in blue, and fixed points in gold.
%e A354368 The earliest pairs with their square sum: (2, 7) = 9, (3, 13) = 16, (5, 11) = 16, (17, 19) = 36, (23, 41) = 64, (29, 71) = 100, (31, 113) = 144, (37, 107) = 144, etc.
%t A354368 Clear[c, a]; nn = 66; c[_] = 0; a[1] = 2; c[2] = 1; u = 3; Do[k = u; If[EvenQ@ i, While[Nand[c[k] == 0, IntegerQ@ Sqrt[# + k]] &[a[i - 1]], k = NextPrime[k]]]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 0, u = NextPrime[u]]], {i, 2, nn}]; Array[a, nn] (* _Michael De Vlieger_, May 24 2022 *)
%Y A354368 Cf. A354367, A354369, A354370 (same idea).
%K A354368 nonn
%O A354368 1,1
%A A354368 _Eric Angelini_ and _Carole Dubois_, May 24 2022