# [seqfan] Re: A154676

Peter Pein petsie at dordos.net
Fri Jan 16 02:24:53 CET 2009

```zak seidov schrieb:
> Terms in A154676 are of the form 3708 n^2,
> and 1262 values of n<10^5 are in
> http://zak08.livejournal.com/4070.html
>
> In general A154676 is rather raw and needs some editing -
>
>
>
>
>
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>

Dear group,

could someone please check, if the following Mathematica-code gives correct
results. It seems slightly more efficient than that published in OEIS.
sorry for the unformatted output, but it is nearly 2:30am and I want to go to bed.
Have a nice day/night/time
Peter

Timing[lst = {};
Do[If[PrimeQ[n - 1] &&
PrimeQ[n + 1],
If[IntegerQ[Sqrt[n*103]],
AppendTo[lst, n]]],
{n, 9!, 2*11!, 6}]; lst]
Out[1]=
{139.704731*Second, {2317500, 12047292, 26163648, 43250112, 47347452, 61704828}}
In[2]:=
Timing[lst = {}; Do[n = k^2/103;
If[PrimeQ[n - 1] && PrimeQ[
n + 1], AppendTo[lst, n]],
{k, 103, 10300000, 103}]; lst]
Out[5]=
{1.096068*Second, {2317500, 12047292,
26163648, 43250112, 47347452,
61704828, 168228252, 333720000,
351755712, 426127068, 513127872,
840143808, 979638768, 998790588,
1089276912, 1330434108, 1357220700,
1388809152, 1694467008, 1927570428,
1986835392, 2035992348, 2136108348,
2858437872, 3070594800, 3241626300,
3903322608, 5136799932, 5250898800,
5303982528, 5812304832, 5830889328,
6598593648, 7298860572, 7371874800,
8232130800, 8566963200, 9779390208,
10640610288, 11097673200,
11136195612, 11174784768,
11316849372, 11708859132,
13428184572, 14027456700,
15265246428, 15719995548,
15919126272, 16445855088,
18012040128, 18422979228,
18821841372, 18955744668,
19496104092, 19547152128,
20095817472, 20407778928,
20774770812, 21198194748,
21429332928, 23603381532,
24186972528, 24452865792,
24720212592, 24950523888,
25085365308, 25667372988,
26572747932, 27211829148,
31356568512, 32028669468,
33039114300, 34879261212,
37780307712, 38877059952,
38949132348, 42663002112,
43904503548, 45034494300,
45215589312, 46152675072,
46336002300, 46362221568,
50872336128, 51423196608,
52227213372, 54193639932,
55764181872, 57707696700,
58647689532, 59061324348,
61936833852, 62361889308,
64539905472, 64570848732,
67702625532, 70293727728,
72670603932, 74620518768,
74886901488, 76326840252,
80486889948, 81665915292,
81700722288, 84226315248,
84650985072, 88629806268,
96293852928, 96596425728,
97316938332, 100573062912,
101075782428, 101812780800,
108726810300, 110379506688,
110500925148, 110703437568,
111068427132, 112943310588,
114256832508, 114503963292,
118201087728, 118368630000,
119839686300, 120980708352,
124866191772, 125167618800,
125771563008, 126723554928,
126853650108, 127114040700,
129732630300, 134334762588,
135453002688, 139608039168,
144936464832, 146377338012,
149468742108, 150506388828,
152640027648, 160055449200,
160201651932, 160689476412,
163927717308, 164865926592,
165311275932, 169246231488,
172720957500, 175006105200,
176282120700, 189085310748,
189244217088, 197599320000,
199118057472, 202392073152,
203379483888, 204314244732,
206854343388, 209800434672,
212655019932, 214681634748,
215472358332, 219676043772,
222079984668, 230129173872,
247686720732, 251458854300,
255628811772, 259398687168,
260392075200, 278726281200,
281885723388, 285974026992,
286886536128, 289829445948,
292655590848, 295826553792,
296356708800, 297750623868,
305643917628, 305711251200,
309426018300, 310103840700,
314186348700, 323400343068,
331694556912, 343797012828,
345584546928, 347233171932,
360417158748, 363788264700,
364817368188, 364890931200,
376980824412, 395370231408,
396596422512, 400671740700,
401520171888, 405465532092,
407795342652, 410756017500,
413727401052, 417574729152,
419307892848, 420649614108,
421914368412, 423339486300,
426515017500, 430261428672,
439981820892, 443543429052,
453493891548, 458840438208,
464052377052, 477673830000,
484516057788, 487402602300,
489189750768, 489360125952,
498260512512, 504815366592,
515602086912, 516214414908,
518228908272, 523590694812,
525089880000, 529688927232,
530398252800, 532795730652,
548556213852, 562078455552,
563997512412, 564454912752,
564820966512, 571154071068,
575118646128, 581509061532,
588962438172, 606854428092,
608373343548, 610845630300,
636621362172, 649316367612,
654922162800, 655316456688,
663624037872, 685226667888,
692605784412, 703697476608,
719621797788, 721586070000,
723242270448, 729990107388,
743579779068, 755070793200,
761965170300, 769959154800,
786828289212, 803552674428,
805081794300, 806502992832,
809239589532, 820563254208,
823544608572, 827860553712,
835301460348, 841099437468,
845237131632, 849946276800,
876878533872, 887860858608,
890272352700, 900297668592,
907476401088, 913984920000,
922621133808, 938716987068,
944862804252, 949010702832,
954833022972, 959957074800,
966171920112, 975411503388,
981676095228}}

```