A280992 Squarefree triangular numbers that are products of consecutive primes.
1, 3, 6, 15, 105, 210, 255255
Offset: 1
Examples
The triangular number 255255 = 714*715/2 is a term because 255255 = 3*5*7*11*13*17 is a product of distinct consecutive primes. 1 (the empty product) is a term, so is 3 (the product of just one triangular number).
Programs
-
Maple
# reuses code of A097889 and A061304 isA280992 := proc(n) isA097889(n) and isA061304(n) ; end proc: for t from 0 do n := t*(t+1)/2 ; if isA280992(t) then print(t) ; end if; end do: # R. J. Mathar, Oct 20 2017
-
Mathematica
Select[PolygonalNumber@ Range[10^5], And[NoneTrue[#[[All, -1]], # > 1 &], Union@ Differences[PrimePi[#[[All, 1]] ] ] == {1}] &@ FactorInteger@ # &] (* Michael De Vlieger, Oct 06 2017 *)
-
PARI
is(n) = my(f=factor(n)[, 1]); for(k=1, #f-1, if(f[k+1]!=nextprime(f[k]+1), return(0))); ispolygonal(n, 3) && issquarefree(n) search(start) = if(start < 4, if(start < 2, print1(1, ", ")); print1(3, ", ")); forcomposite(c=start, , if(is(c), print1(c, ", "))) /* Start a search from 1 upwards as follows: */ search(1) \\ Felix Fröhlich, Oct 21 2017 [Corrected Jun 10, 2019]
-
PARI
uptoprime(n) = {my(prim = vector(n), i = 2, res = List([1])); prim[1] = 2; forprime(p = 3, , prim[i] = prim[i - 1] * p; i++; if(i>n, break)); for(i=1, n, if(issquare(8 * prim[i] + 1), listput(res, prim[i])); for(j=1, i-1, c = prim[i]/prim[j]; if(issquare(8 * c + 1), listput(res, c)))); listsort(res); res} \\ David A. Corneth, Oct 21 2017
Extensions
1 and 3 prepended by David A. Corneth, Oct 21 2017
Comments