[seqfan] Re: Phenix seq by (prime-next term) operation

M. F. Hasler seqfan at hasler.fr
Wed Dec 25 11:32:29 CET 2019


Hello Eric,
my very simple program below confirms your terms and gives more:
(1, 5, 4, 11, 6, 13, 9, 19, 8, 29, 23, 10, 31, 22, 37, 18, 41, 33, 43, 14,
47, 24, 59, 49, 61, 30, 67, 45, 53, 16, 73,
55, 79, 38, 83, 50, 71, 28, 89, 75, 101, 54, 109, 85, 103, 44, 97, 48, 107,
46, 149, 119, 127, 60, 113, 68, 131, 78, 137, 121, 139,
66, 151, 96, 163, 84, 167, 129, 157, 74, 173, 123, 179, 108, 181, 153, 191,
102, 193, 118, 199, 98, 197, 143, 223, 114, 211, 126, 227, 124, 229, 185,
233, 136, 251, 203, 239, 132, 241, 195, ...)

I will submit it but would prefer if you donate all the $(1+2) to OEIS in
case it is accepted !

Merry christmas to you and all SeqFans,
--
Maximilian

{A=List( U=[i=1] ); for (n=1, 99, printf("a(%d) = %d, ",n,A[n]); n>#A ||
listput( A, 0);
if( isprime(A[n]),  /* if a(n) is prime, we don't have a choice, the rule
gives next term by "fractality". */
 if( !setsearch( U, A[n+1] = A[n] - A[i] ) && A[n+1] > 0, i++;
U=setunion(U, [A[n+1]]); next ,
/* We tentatively set the next term to what it must be, but there's a
problem: we'll have to backtrack */
print1("no, "); until ( n==1 || ! isprime( A[n] ) || !U=setminus(U,
[A[n]]),  n--; i-- ); i++
));
/* try the next larger prime such that the result from the upcoming imposed
difference is not yet in the sequence */
forprime( k=A[n+1]+1,oo, ! setsearch(U,k) && ! setsearch(U, k-A[i]) && [
U=setunion( U, [A[n+1] = k]), break ]))}


On Wed, Dec 25, 2019, 06:32 Éric Angelini <eric.angelini at skynet.be> wrote:

> Hello SeqFans,
> If we call R the result of [a(n)-a(n+1) when a(n) is prime],
> then the successive such Rs will rebuild S itself:
> S = 1, 5, 4, 11, 6, 13, 9, 19, 8, 29, 23, 10, 31, 22, 37, 18,...
> S should be the lexicographically earliest seq of distinct
> positive terms with a(1)=1  and the obligation for nonprimes
> to be followed by at least one prime. [This is why a(2),
> above, is not 4, for instance].
> Best,
> É.
> P.-S.
> If a member M of the list thinks that
> a seq S proposed by me is worth entering
> the OEIS, I will donate 1$ to the OEIS
> and 2$ to M -- provided that M does
> check my seq S, extend it, compute a
> b-file, fill properly the OEIS form,
> submit it as a draft and follow the
> requests of the Correction Team.
> M will be at least the co-author of
> the seq S (or better, the only author),
> as M will take all the decisions about
> S by himself, not needing to refer in
> any way to me. This deal applies
> immediately to the above S (and yes,
> I will use Paypal the very day any S
> fully enters the OEIS).
>
>
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list