[seqfan] Re: Programs in A280992

rgwv at rgwv.com rgwv at rgwv.com
Sat Dec 30 20:30:52 CET 2017


Seqfans, Here is what I have for A280992:
fQ[n_] := Block[{fi = Sort@ Join[ FactorInteger[ n/If[ OddQ@ n, 1, 2]], FactorInteger[(n +1)/If[ OddQ@ n, 2, 1]]]}, Times @@ (Last@# & /@ fi) == 1 && NextPrime[fi[[1, 1]], Length at fi -1] == fi[[-1, 1]]];
k = 3; lst = {1, 2}; While[k < 100000001, If[fQ@ k, AppendTo[lst, k]; Print at k]; k++]; lst(lst +1)/2

Instead of factoring the n-th triangular number, I factor n and n+1 separately and join the results. The other speed up was not computing PrimePi of all the factors. Instead if k was the number of primes, I looked for the (k-1)-th prime after the first prime and was that the last prime? Between the two, my program is about 10 times quicker that the one presented.

As a result I have been able to verify that the terms {1, 3, 6, 15, 105, 210, 255255} are the only terms up to the 10^8-th triangular number. This took approximately 1:28. Bob.

-----Original Message-----
From: SeqFan [mailto:seqfan-bounces at list.seqfan.eu] On Behalf Of Felix Fröhlich
Sent: Saturday, 30 December, 2017 5:06 AM
To: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
Subject: [seqfan] Programs in A280992

Dear SeqFans

I believe that several of the programs in A280992 need to be fixed. Is that correct?

Best regards
Felix

--
Seqfan Mailing list - http://list.seqfan.eu/




More information about the SeqFan mailing list