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.

A073755 Number of steps needed to reach a prime when the following map is repeatedly applied to n: if n is even then 2n + int(sqrt(n)) + 1, otherwise 2n - int(sqrt(n)) - 1; or -1 if no prime is ever reached.

This page as a plain text file.
%I A073755 #11 Dec 17 2024 22:35:39
%S A073755 10,2,1,1,9,1,1,4,2,2,5,28,3,8,1,1,1,17,2,1,27,1,1,34,7,2,4,12,4,3,2,
%T A073755 16,2,2,1,1,1,1,12,4,9,1,33,1,6,12,1,26,2,16,11,5,21,4,2,2,6,8,15,2,3,
%U A073755 6,1,11,3,27,2,4,1,15,2,1,1,3,12,2,2,1,8,2,7,3,6,3,16,11,4,2,25,8,4,10
%N A073755 Number of steps needed to reach a prime when the following map is repeatedly applied to n: if n is even then 2n + int(sqrt(n)) + 1, otherwise 2n - int(sqrt(n)) - 1; or -1 if no prime is ever reached.
%H A073755 Sean A. Irvine, <a href="/A073755/b073755.txt">Table of n, a(n) for n = 2..1000</a>
%e A073755 For n=3, a(3)=2 because 3 -> 4 -> 11
%o A073755 (UBASIC)
%o A073755 10 cls
%o A073755 30 for I=2 to 100
%o A073755 32 H=I
%o A073755 40 if odd(H)=1 then goto 90 else goto 50
%o A073755 50 A=2*H+int(sqrt(H))+1:K=K+1
%o A073755 60 if prmdiv(A)=A then print I,K:goto 120
%o A073755 65 if K>1000 then print I,0:goto 120
%o A073755 70 H=A:goto 40
%o A073755 90 A=2*H-int(sqrt(H))-1:K=K+1
%o A073755 100 if prmdiv(A)=A then print I,K:goto 120
%o A073755 105 if K>1000 then print I,0:goto 120
%o A073755 110 H=A:goto 40
%o A073755 120 K=0
%o A073755 130 next
%K A073755 easy,nonn
%O A073755 2,1
%A A073755 _Felice Russo_, Sep 02 2002