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.

A347840 A surjective map of the positive numbers congruent to 5 modulo 8 (A004770) to the positive numbers congruent to 1, 3, or 7 modulo 8 (A047529).

This page as a plain text file.
%I A347840 #47 Jun 25 2025 11:26:56
%S A347840 1,3,1,7,9,11,3,15,17,19,1,23,25,27,7,31,33,35,9,39,41,43,11,47,49,51,
%T A347840 3,55,57,59,15,63,65,67,17,71,73,75,19,79,81,83,1,87,89,91,23,95,97,
%U A347840 99,25,103,105,107,27,111,113,115,7,119,121
%N A347840 A surjective map of the positive numbers congruent to 5 modulo 8 (A004770) to the positive numbers congruent to 1, 3, or 7 modulo 8 (A047529).
%C A347840 This map is obtained from the array A(k, m) given in A347834. There all positive numbers congruent to 5 modulo 8 (A004770) appear uniquely in the columns for m >= 1, and the m = 0 column gives all numbers congruent to {1, 3, 7} (mod 8) (A047529). The surjective map is f: A004770 -> A047529, with b(n) = A004770(n) -> f(b(n)) = a(n).
%C A347840 See also the array A178415 which has permuted rows.
%C A347840 This maps all entries of each row k of the array A(k, m), given in A347834, with columns m >= 1 to the entry A(k, 0) = A047529(k), for k >= 1. The numbers b(n) appear once in the array A for columns m >= 1. Column A(k, 1) = A347836(k) gives the numbers congruent to {5, 32, 29} (mod 32), and each entry for columns m >= 2 is congruent to 21 (mod 32).
%C A347840 The surjective map of the numbers b(n) = 5 + 8*(n-1) = A004770(n), for n >= 1, to A047529 with element a(n), is computed by switching to the companion array A347839 of A347834, with the simple recurrence, removing all factors of 4, and then going back to array A347834. See the formula below. Thanks to _Antti Karttunen_ for motivating me to simplify the prescription, and to add in A347834 the hint for the induction proof that all 5 (mod 8) numbers appear once in the columns n >= 1.
%C A347840 This map f is of interest in the context of the Collatz 3*n+1 conjecture. The (modified) rooted tree with only odd labeled nodes has for each row k of the array A(k, m) (A347834) the same precursor (or (modified) Collatz map given in A075677(n+1), for 2*n+1). Therefore, all nodes with labels b(n) == 5 (mod 8) can be represented by a(n). This leads to a further restricted Collatz tree with only node labels congruent to {1, 3, 7} (mod 8) (A047529).
%C A347840 An even further restricted Collatz tree has only node labels congruent to 1 (mod 8) (A017077), as any positive integer can be written as m*2^(v+1)+2^v-1 or (m,v) where v is the number of trailing 1-bits in binary, and for v > 1 the next odd Collatz successor of (m,v) is (3*m+1,v-1). - _Ruud H.G. van Tol_, Sep 13 2023
%H A347840 Paolo Xausa, <a href="/A347840/b347840.txt">Table of n, a(n) for n = 1..10000</a>
%F A347840 a(n) = (2*A065883((3*b(n)+1)/2) - 1)/3, with b(n) = A004770(n), for n >= 1.
%F A347840 a(n) = A385109(8*(n-1)+5). - _Ralf Stephan_, Jun 18 2025
%e A347840 The sequence a(n) begins: (b(n) = A004770(n))
%e A347840 -------------------------------------------------------------------------
%e A347840 n:     1  2  3  4  5  6  7  8  9 10 11 12  13  14  15  16  17  18  19  20
%e A347840 b(n):  5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157
%e A347840 a(n):  1  3  1  7  9 11  3 15 17 19  1 23  25  27   7  31  35  35   9  39
%e A347840 -------------------------------------------------------------------------
%e A347840 n:     21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37 ...
%e A347840 b(n): 165 173 181 189 197 205 213 221 229 237 245 253 261 269 277 285 293 ...
%e A347840 a(n):  41  43  11  47  49  51   3  55  57  59  15  63  65  67  17  71  73 ...
%e A347840 -----------------------------------------------------------------------------
%e A347840 n = 6, b(6) = 45 = 13 + 32*1, case a), a(6) = 3 + 8*1 = 11.
%e A347840 n = 7, b(7) = 53 = 21 + 32*1, case b)1), first instance, L(7) = 0, a(7) = 3 + 8*0 = 3.
%e A347840 n = 31, b(31) = 245 = 117 + 128*1, case b)1), second instance, L(31) = 1, a(31) = 7 + 8*1 = 15.
%e A347840 n = 11, b(11) = 85 = 21 + 64*1, A065883(1 + 3*1) = 1, c(11) = 1, case b)2)i), a(11) = 85 = A347834(1, 3).
%e A347840 n = 19, b(19) = 149 = 21 + 64*2, A065883(1 + 3*2) = 7, c(19) = (7 - 1)/3 = 2, case b)2)ii), a(n) = 4*2 + 1 = 9.
%t A347840 A347840[n_] := NestWhile[Quotient[#, 4] &, 2*n - 1, Mod[#, 8] == 5 &];
%t A347840 Array[A347840, 100] (* _Paolo Xausa_, Jun 25 2025 *)
%o A347840 (PARI) a(n) = n=2*n-1; while(5==n%8, n>>=2); n; \\ _Ruud H.G. van Tol_, Sep 13 2023
%o A347840 (PARI) a(n) = (2*n-1)>>(valuation(3*n-1,2)\2*2); \\ _Ruud H.G. van Tol_, Sep 20 2023
%Y A347840 Cf. A004770, A047529, A075677, A178415, A347834, A347836, A349414.
%K A347840 nonn,easy
%O A347840 1,2
%A A347840 _Wolfdieter Lang_, Oct 30 2021