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.

A135761 Natural numbers with every odd prime p swapped with p+1.

This page as a plain text file.
%I A135761 #10 Nov 08 2016 07:45:49
%S A135761 1,2,4,3,6,5,8,7,9,10,12,11,14,13,15,16,18,17,20,19,21,22,24,23,25,26,
%T A135761 27,28,30,29,32,31,33,34,35,36,38,37,39,40,42,41,44,43,45,46,48,47,49,
%U A135761 50,51,52,54,53,55,56,57,58,60,59,62,61,63,64,65,66,68,67,69,70,72,71
%N A135761 Natural numbers with every odd prime p swapped with p+1.
%H A135761 G. C. Greubel, <a href="/A135761/b135761.txt">Table of n, a(n) for n = 1..10000</a>
%e A135761 Start with sequence of positive integers, then swap a(i) and a(i+1) if a(i) is an odd prime:
%e A135761 a(1)=1, a(2)=2, then a(3)=4 and a(4)=3 because p=3 is odd prime and p and p+1 are swapped.
%p A135761 f:= proc(n) if isprime(2*n+1) then (2*n+2,2*n+1) else (2*n+1,2*n+2) fi end proc:
%p A135761 map(f, [$0..100]); # _Robert Israel_, Nov 07 2016
%t A135761 r=Range[100];Do[If[PrimeQ[r[[i]]],{r[[i]],r[[i+1]]}={r[[i+1]],r[[i]]}],{i,3,97,2}];r
%Y A135761 Cf. A135762.
%K A135761 nonn
%O A135761 1,2
%A A135761 _Zak Seidov_, Nov 27 2007