A224076 Row lengths of triangle in A224075.
1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 3, 2, 2, 3, 2, 4, 4, 3, 3, 2, 2, 4, 3, 4, 3, 4, 4, 3, 4, 5, 4, 4, 6, 5, 10, 6, 6, 10, 8, 11
Offset: 1
Programs
-
Haskell
a224076 = length . a224075_row
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.
a224076 = length . a224075_row
For example, the number 20 is part of this sequence because 20-1*1 = 19 (prime), and 20-3*3 = 11 (prime). Not considered are 20-2*2 and 20-4*4, because 2 and 4 are not relative primes to 20.
a214583 n = a214583_list !! (n-1) a214583_list = filter (p 3 1) [2..] where p i k2 x = x <= k2 || (gcd k2 x > 1 || a010051' (x - k2) == 1) && p (i + 2) (k2 + i) x -- Reinhard Zumkeller, Mar 31 2013, Jul 22 2012
Reap[For[p = 2, p < 2000, p = NextPrime[p], n = p+1; q = True; k = 1; While[k*k < n, If[GCD[k, n] == 1, If[! PrimeQ[n - k^2], q = False; Break[]]]; k += 1]; If[q, Sow[n]]]] [[2, 1]] (* Jean-François Alcover, Oct 11 2013, after Joerg Arndt's Pari program *) gQ[n_]:=AllTrue[n-#^2&/@Select[Range[Floor[Sqrt[n]]],CoprimeQ[ #, n]&], PrimeQ]; Select[Range[2000],gQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 02 2018 *)
N=10^10; default(primelimit,N); { forprime (p=2, N, n = p + 1; q = 1; k = 1; while ( k*k < n, if ( gcd(k,n)==1, if ( ! isprime(n-k^2), q=0; break() ); ); k += 1; ); if ( q, print1(n,", ") ); ); } /* Joerg Arndt, Jul 21 2012 */
Comments