login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306807 An irregular fractal sequence: underline a(n) iff the absolute difference |a(n-1) - a(n)| is prime; all underlined terms rebuild the starting sequence. 1
1, 2, 3, 1, 5, 2, 6, 3, 1, 7, 5, 2, 8, 6, 3, 1, 9, 7, 5, 2, 10, 8, 6, 3, 1, 11, 9, 7, 5, 2, 12, 10, 8, 6, 3, 1, 13, 11, 9, 7, 5, 2, 14, 12, 10, 8, 6, 3, 1, 15, 13, 11, 9, 7, 5, 2, 16, 14, 12, 10, 8, 6, 3, 1, 17, 15, 13, 11, 9, 7, 5, 2, 18, 16, 14, 12, 10, 8, 6, 3, 1, 19, 17, 15, 13, 11, 9, 7, 5, 2, 20, 18, 16, 14, 12, 10, 8, 6, 3, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The sequence S starts with a(1) = 1 and a(2) = 2. S is extended by duplicating the first term A among the not yet duplicated terms, under the condition that the absolute difference |a(n-1) - a(n)| is prime. If this is not the case, we then extend S with the smallest integer X not yet present in S such that the absolute difference |a(n-1) - a(n)| is not prime. S is the lexicographically earliest sequence with this property.
LINKS
EXAMPLE
S starts with a(1) = 1 and a(2) = 2
Can we duplicate a(1) to form a(3)? No, as |a(2) - a(3)| would be 1 and 1 is not prime. We thus extend S with the smallest integer X not yet in S such that |a(2) - X| is not prime. We get a(3) = 3.
Can we duplicate a(1) to form a(4)? Yes, as |a(3) - a(4)| = 2, which is prime. We get a(4) = 1.
Can we duplicate a(2) to form a(5)? No, as |a(4) - a(5)| would be 1 and 1 is not prime. We thus extend S with the smallest integer X not yet in S such that |a(4) - X| is not prime; we get a(5) = 5.
Can we duplicate a(2) to form a(6)? Yes, as |a(6) - a(5)| = 3, which is prime; we get a(6) = 2.
Etc.
CROSSREFS
Cf. A306803 (obtained by replacing the absolute difference by the sum in the definition).
Sequence in context: A304880 A086686 A361614 * A021816 A055023 A323071
KEYWORD
base,nonn,look
AUTHOR
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)