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.

A233443 Primes that are exactly between the nearest square and the nearest triangular number.

This page as a plain text file.
%I A233443 #24 Aug 15 2014 05:43:53
%S A233443 2,5,23,47,193,389,1667,8807,9431,10177,10597,10847,11831,13411,17183,
%T A233443 22433,29201,33893,36073,38321,40093,42461,48991,50131,54287,54851,
%U A233443 57037,63347,65183,67121,71917,87803,88607,91291,94847,104491,108293,112163,116101,117167,122033
%N A233443 Primes that are exactly between the nearest square and the nearest triangular number.
%C A233443 A subsequence of A233074.
%t A233443 nearestTri[n_] := Block[{a = Floor@ Sqrt[ 2n - 1]}, If[ 4n < a (a + 3), a (a - 1)/2, a (a + 1)/2]]; nearestSq[n_] :=  Block[{a = Floor@ Sqrt@ n}, If[a^2 + a + 1/2 > n, a^2, a^2 + 2 a + 1]]; Select[ Prime@ Range@ 12000, 2# == nearestSq@# + nearestTri@# &] (* _Robert G. Wilson v_, Aug 01 2014 *)
%o A233443 (PARI) lista(nn) = {forprime(p=2, nn, sqp = sqrtint(p); ps = sqp^2; ns = (sqp+1)^2; sqt = floor((sqrt(8*p+1) - 1)/2); pt = sqt*(sqt+1)/2; nt = (sqt+2)*(sqt+1)/2; if (((ds=p-ps) < (ns-p)) && ((dt=(nt-p)) <= p-pt) && (ds == dt), print1(p, ", "), if (((ds=ns-p) < (p-ps)) && ((dt=(p-pt)) < nt-p) && (ds == dt), print1(p, ", "));););} \\ _Michel Marcus_, Aug 11 2014
%Y A233443 Cf. A000040, A000217, A000290, A233074.
%K A233443 nonn
%O A233443 1,1
%A A233443 _Alex Ratushnyak_, Dec 09 2013
%E A233443 Corrected by _Alex Ratushnyak_, Jun 08 2014