OFFSET
1,3
COMMENTS
A088178 is the sequence of distinct products a(i)a(i+1), i=1,2,3,... and appears to be a permutation of the natural numbers.
It appears that for k>2 the k-th occurrence of 1 lies between the first occurrences of primes p(2*k-4) and p(2*k-3). For instance, the 5th occurrence of 1 lies between the first occurrences of 13 and 17, the 6th and 7th primes, respectively. - John W. Layman, Nov 16 2011
Note that a(n) = 1 for infinitely many n, because the sequence a(n) is not bounded and beside every new prime number must be the number 1. - Thomas Ordowski, Sep 04 2014. [This seems a rather sketchy argument, but I have a more complete proof using arguments similar to those we used in A098550. - N. J. A. Sloane, Oct 18 2021]
Example: ..., 5, 13, 1, 17, 2, 13, 3, 17, 4; ...
General: ..., k, p, 1, q, 2, p, 3, q, ..., k-1; ...
- Thomas Ordowski, Sep 08 2014
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000, (first 1000 terms from T. D. Noe)
FORMULA
EXAMPLE
Given that the sequence begins 1,1,2,2,... then a(5)=3, since either of the choices a(5)=1 or a(5)=2 would lead to a repetition of one of the previous products 1,2,4 of adjacent pairs of terms.
MAPLE
A[1]:= 1: A[2]:= 1: S:= {1}:
for n from 3 to 100 do
Sp:= select(type, map(s -> s/A[n-1], S), integer);
if nops(Sp) = Sp[-1] then A[n]:= Sp[-1]+1
else A[n]:= min({$1..Sp[-1]} minus Sp)
fi;
S:= S union {A[n-1]*A[n]};
od:
seq(A[n], n=1..100); # Robert Israel, Aug 28 2014
MATHEMATICA
t = {1, 1}; Do[AppendTo[t, 1]; While[Length[Union[Most[t]*Rest[t]]] < n - 1, t[[-1]]++], {n, 3, 100}]; t (* T. D. Noe, Nov 16 2011 *)
PROG
(Python)
from itertools import islice
def A088177(): # generator of terms
yield 1
yield 1
p, a = {1}, 1
while True:
n = 1
while n*a in p:
n += 1
p.add(n*a)
a = n
yield n
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
John W. Layman, Sep 22 2003
STATUS
approved