The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.



(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A128110 Largest prime x such that x/(n^k), rounded up, is 1 or a prime for all positive integer values of k. 1
5, 109, 163, 751, 37181, 1220423, 420001, 59757913, 16660807, 199067023, 766462903201, 641418438961, 610994816525833, 834251799269401, 46727045369489101, 21346113465023, 42439483778365061, 17596652626197454349, 1525870657210709129 (list; graph; refs; listen; history; text; internal format)



The program below is for C++ and does not work for numbers above a certain point due to integer restrictions.


Table of n, a(n) for n=2..20.


S(3)=109 because 109 is a prime, 109/3 rounded up, or 37, is a prime; 109/3^2 rounded up, or 13, is a prime; 109/3^3 rounded up, or 5, is a prime;109/3^4 rounded up, or 2, is a prime; 109/3^5 rounded up is one.


#include <iostream> #include <cmath> #include <tchar.h> using namespace std; unsigned long int sqrot; unsigned long int test; void primetest (unsigned long long int& x, bool& t){ sqrot=10000000000; test=2; while(sqrot>test && x>test && x%test!=0){ test=test+1; } if(sqrot==test || x==test){ t=true; }else{ t=false; }} int main() { int a; int b; unsigned int k; unsigned long long int c; unsigned long long int prime; unsigned long long int array[2000]; int number=2; bool t; unsigned int d=1; number=2; while(number>1){ array[1]=1; a=1; b=1; while(a<=b){ prime=number*array[a]; k=number-1; while (prime-k<= prime){ c=prime-k; primetest(c, t); if(t==true){ b++; array[b]=c; if(c>d){ d=c; }else{} }else{} k--; } a++; } cout<<d<<", "; number++; d=1; } cin>>a; return 0; }

Contribution from Max Alekseyev, May 21 2009: (Start)

(PARI) { a(n, q) = local(t, b, r); t=(q-1)*n; b=q*n; r=[]; while(1, t=nextprime(t+1); if(t>b, break); r=concat(r, [t]); ); r }

{ A128110(n, s=1) = local(m, t); m=s; t=a(n, s); for(k=1, #t, m=max(m, A128110(n, t[k])); ); m } (End)


Sequence in context: A048564 A139971 A305095 * A316755 A199307 A195561

Adjacent sequences:  A128107 A128108 A128109 * A128111 A128112 A128113




Alex Smith (Indeed123(AT)gmail.com), Feb 15 2007


Corrected and extended by Max Alekseyev, May 21 2009



Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 23 03:02 EDT 2021. Contains 345395 sequences. (Running on oeis4.)