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.

Showing 1-9 of 9 results.

A048673 Permutation of natural numbers: a(n) = (A003961(n)+1) / 2 [where A003961(n) shifts the prime factorization of n one step towards larger primes].

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 6, 14, 13, 11, 7, 23, 9, 17, 18, 41, 10, 38, 12, 32, 28, 20, 15, 68, 25, 26, 63, 50, 16, 53, 19, 122, 33, 29, 39, 113, 21, 35, 43, 95, 22, 83, 24, 59, 88, 44, 27, 203, 61, 74, 48, 77, 30, 188, 46, 149, 58, 47, 31, 158, 34, 56, 138, 365, 60, 98, 36, 86, 73
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Inverse of sequence A064216 considered as a permutation of the positive integers. - Howard A. Landman, Sep 25 2001
From Antti Karttunen, Dec 20 2014: (Start)
Permutation of natural numbers obtained by replacing each prime divisor of n with the next prime and mapping the generated odd numbers back to all natural numbers by adding one and then halving.
Note: there is a 7-cycle almost right in the beginning: (6 8 14 17 10 11 7). (See also comments at A249821. This 7-cycle is endlessly copied in permutations like A250249/A250250.)
The only 3-cycle in range 1 .. 402653184 is (2821 3460 5639).
For 1- and 2-cycles, see A245449.
(End)
The first 5-cycle is (1410, 2783, 2451, 2703, 2803). - Robert Israel, Jan 15 2015
From Michel Marcus, Aug 09 2020: (Start)
(5194, 5356, 6149, 8186, 10709), (46048, 51339, 87915, 102673, 137205) and (175811, 200924, 226175, 246397, 267838) are other 5-cycles.
(10242, 20479, 21413, 29245, 30275, 40354, 48241) is another 7-cycle. (End)
From Antti Karttunen, Feb 10 2021: (Start)
Somewhat artificially, also this permutation can be represented as a binary tree. Each child to the left is obtained by multiplying the parent by 3 and subtracting one, while each child to the right is obtained by applying A253888 to the parent:
1
|
................../ \..................
2 3
5......../ \........4 8......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
14 13 11 7 23 9 17 18
41 10 38 12 32 28 20 15 68 25 26 63 50 16 53 19
etc.
Each node's (> 1) parent can be obtained with A253889. Sequences A292243, A292244, A292245 and A292246 are constructed from the residues (mod 3) of the vertices encountered on the path from n to the root (1).
(End)

Examples

			For n = 6, as 6 = 2 * 3 = prime(1) * prime(2), we have a(6) = ((prime(1+1) * prime(2+1))+1) / 2 = ((3 * 5)+1)/2 = 8.
For n = 12, as 12 = 2^2 * 3, we have a(12) = ((3^2 * 5) + 1)/2 = 23.
		

Crossrefs

Inverse: A064216.
Row 1 of A251722, Row 2 of A249822.
One more than A108228, half the terms of A243501.
Fixed points: A048674.
Positions of records: A029744, their values: A246360 (= A007051 interleaved with A057198).
Positions of subrecords: A247283, their values: A247284.
Cf. A246351 (Numbers n such that a(n) < n.)
Cf. A246352 (Numbers n such that a(n) >= n.)
Cf. A246281 (Numbers n such that a(n) <= n.)
Cf. A246282 (Numbers n such that a(n) > n.), A252742 (their char. function)
Cf. A246261 (Numbers n for which a(n) is odd.)
Cf. A246263 (Numbers n for which a(n) is even.)
Cf. A246260 (a(n) reduced modulo 2), A341345 (modulo 3), A341346, A292251 (3-adic valuation), A292252.
Cf. A246342 (Iterates starting from n=12.)
Cf. A246344 (Iterates starting from n=16.)
Cf. A245447 (This permutation "squared", a(a(n)).)
Other permutations whose formulas refer to this sequence: A122111, A243062, A243066, A243500, A243506, A244154, A244319, A245605, A245608, A245610, A245612, A245708, A246265, A246267, A246268, A246363, A249745, A249824, A249826, and also A183209, A254103 that are somewhat similar.
Cf. also prime-shift based binary trees A005940, A163511, A245612 and A244154.
Cf. A253888, A253889, A292243, A292244, A292245 and A292246 for other derived sequences.
Cf. A323893 (Dirichlet inverse), A323894 (sum with it), A336840 (inverse Möbius transform).

Programs

  • Haskell
    a048673 = (`div` 2) . (+ 1) . a045965
    -- Reinhard Zumkeller, Jul 12 2012
    
  • Maple
    f:= proc(n)
    local F,q,t;
      F:= ifactors(n)[2];
      (1 + mul(nextprime(t[1])^t[2], t = F))/2
    end proc:
    seq(f(n),n=1..1000); # Robert Israel, Jan 15 2015
  • Mathematica
    Table[(Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n, {n, 69}] (* Michael De Vlieger, Dec 18 2014, revised Mar 17 2016 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2; \\ Antti Karttunen, Dec 20 2014
    
  • PARI
    A048673(n) = if(1==n,n,if(n%2,A253888(A048673((n-1)/2)),(3*A048673(n/2))-1)); \\ (Not practical, but demonstrates the construction as a binary tree). - Antti Karttunen, Feb 10 2021
    
  • Python
    from sympy import factorint, nextprime, prod
    def a(n):
        f = factorint(n)
        return 1 if n==1 else (1 + prod(nextprime(i)**f[i] for i in f))//2 # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A048673 n) (/ (+ 1 (A003961 n)) 2)) ;; Antti Karttunen, Dec 20 2014
    

Formula

From Antti Karttunen, Dec 20 2014: (Start)
a(1) = 1; for n>1: If n = product_{k>=1} (p_k)^(c_k), then a(n) = (1/2) * (1 + product_{k>=1} (p_{k+1})^(c_k)).
a(n) = (A003961(n)+1) / 2.
a(n) = floor((A045965(n)+1)/2).
Other identities. For all n >= 1:
a(n) = A108228(n)+1.
a(n) = A243501(n)/2.
A108951(n) = A181812(a(n)).
a(A246263(A246268(n))) = 2*n.
As a composition of other permutations involving prime-shift operations:
a(n) = A243506(A122111(n)).
a(n) = A243066(A241909(n)).
a(n) = A241909(A243062(n)).
a(n) = A244154(A156552(n)).
a(n) = A245610(A244319(n)).
a(n) = A227413(A246363(n)).
a(n) = A245612(A243071(n)).
a(n) = A245608(A245605(n)).
a(n) = A245610(A244319(n)).
a(n) = A249745(A249824(n)).
For n >= 2, a(n) = A245708(1+A245605(n-1)).
(End)
From Antti Karttunen, Jan 17 2015: (Start)
We also have the following identities:
a(2n) = 3*a(n) - 1. [Thus a(2n+1) = 0 or 1 when reduced modulo 3. See A341346]
a(3n) = 5*a(n) - 2.
a(4n) = 9*a(n) - 4.
a(5n) = 7*a(n) - 3.
a(6n) = 15*a(n) - 7.
a(7n) = 11*a(n) - 5.
a(8n) = 27*a(n) - 13.
a(9n) = 25*a(n) - 12.
and in general:
a(x*y) = (A003961(x) * a(y)) - a(x) + 1, for all x, y >= 1.
(End)
From Antti Karttunen, Feb 10 2021: (Start)
For n > 1, a(2n) = A016789(a(n)-1), a(2n+1) = A253888(a(n)).
a(2^n) = A007051(n) for all n >= 0. [A property shared with A183209 and A254103].
(End)
a(n) = A003602(A003961(n)). - Antti Karttunen, Apr 20 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/4) * Product_{p prime} ((p^2-p)/(p^2-nextprime(p))) = 1.0319981... , where nextprime is A151800. - Amiram Eldar, Jan 18 2023

Extensions

New name and crossrefs to derived sequences added by Antti Karttunen, Dec 20 2014

A029744 Numbers of the form 2^n or 3*2^n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864, 2097152, 3145728, 4194304
Offset: 1

Views

Author

Keywords

Comments

This entry is a list, and so has offset 1. WARNING: However, in this entry several comments, formulas and programs seem to refer to the original version of this sequence which had offset 0. - M. F. Hasler, Oct 06 2014
Number of necklaces with n-1 beads and two colors that are the same when turned over and hence have reflection symmetry. [edited by Herbert Kociemba, Nov 24 2016]
The subset {a(1),...,a(2k)} contains all proper divisors of 3*2^k. - Ralf Stephan, Jun 02 2003
Let k = any nonnegative integer and j = 0 or 1. Then n+1 = 2k + 3j and a(n) = 2^k*3^j. - Andras Erszegi (erszegi.andras(AT)chello.hu), Jul 30 2005
Smallest number having no fewer prime factors than any predecessor, a(0)=1; A110654(n) = A001222(a(n)); complement of A116451. - Reinhard Zumkeller, Feb 16 2006
A093873(a(n)) = 1. - Reinhard Zumkeller, Oct 13 2006
a(n) = a(n-1) + a(n-2) - gcd(a(n-1), a(n-2)), n >= 3, a(1)=2, a(2)=3. - Ctibor O. Zizka, Jun 06 2009
Where records occur in A048985: A193652(n) = A048985(a(n)) and A193652(n) < A048985(m) for m < a(n). - Reinhard Zumkeller, Aug 08 2011
A002348(a(n)) = A000079(n-3) for n > 2. - Reinhard Zumkeller, Mar 18 2012
Without initial 1, third row in array A228405. - Richard R. Forberg, Sep 06 2013
Also positions of records in A048673. A246360 gives the record values. - Antti Karttunen, Sep 23 2014
Known in numerical mathematics as "Bulirsch sequence", used in various extrapolation methods for step size control. - Peter Luschny, Oct 30 2019
For n > 1, squares of the terms can be expressed as the sum of two powers of two: 2^x + 2^y. - Karl-Heinz Hofmann, Sep 08 2022

Crossrefs

Cf. A056493, A038754, A063759. Union of A000079 and A007283.
First differences are in A016116(n-1).
Row sums of the triangle in sequence A119963. - John P. McSorley, Aug 31 2010
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent. There may be minor differences from (s(n)) at the start, and a shift of indices. A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A060482 (s(n)-3); A136252 (s(n)-3); A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A354785 (3*s(n)), A061776 (3*s(n)-6); A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    a029744 n = a029744_list !! (n-1)
    a029744_list = 1 : iterate
       (\x -> if x `mod` 3 == 0 then 4 * x `div` 3 else 3 * x `div` 2) 2
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Maple
    1,seq(op([2^i,3*2^(i-1)]),i=1..100); # Robert Israel, Sep 23 2014
  • Mathematica
    CoefficientList[Series[(-x^2 - 2*x - 1)/(2*x^2 - 1), {x, 0, 200}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
    Function[w, DeleteCases[Union@ Flatten@ w, k_ /; k > Max@ First@ w]]@ TensorProduct[{1, 3}, 2^Range[0, 22]] (* Michael De Vlieger, Nov 24 2016 *)
    LinearRecurrence[{0,2},{1,2,3},50] (* Harvey P. Dale, Jul 04 2017 *)
  • PARI
    a(n)=if(n%2,3/2,2)<<((n-1)\2)\1
    
  • Python
    def A029744(n):
        if n == 1: return 1
        elif n % 2 == 0: return 2**(n//2)
        else: return 3 * 2**((n-3)//2) # Karl-Heinz Hofmann, Sep 08 2022
  • Scheme
    (define (A029744 n) (cond ((<= n 1) n) ((even? n) (expt 2 (/ n 2))) (else (* 3 (expt 2 (/ (- n 3) 2)))))) ;; Antti Karttunen, Sep 23 2014
    

Formula

a(n) = 2*A000029(n) - A000031(n).
For n > 2, a(n) = 2*a(n - 2); for n > 3, a(n) = a(n - 1)*a(n - 2)/a(n - 3). G.f.: (1 + x)^2/(1 - 2*x^2). - Henry Bottomley, Jul 15 2001, corrected May 04 2007
a(0)=1, a(1)=1 and a(n) = a(n-2) * ( floor(a(n-1)/a(n-2)) + 1 ). - Benoit Cloitre, Aug 13 2002
(3/4 + sqrt(1/2))*sqrt(2)^n + (3/4 - sqrt(1/2))*(-sqrt(2))^n. a(0)=1, a(2n) = a(n-1)*a(n), a(2n+1) = a(n) + 2^floor((n-1)/2). - Ralf Stephan, Apr 16 2003 [Seems to refer to the original version with offset=0. - M. F. Hasler, Oct 06 2014]
Binomial transform is A048739. - Paul Barry, Apr 23 2004
E.g.f.: (cosh(x/sqrt(2)) + sqrt(2)sinh(x/sqrt(2)))^2.
a(1) = 1; a(n+1) = a(n) + A000010(a(n)). - Stefan Steinerberger, Dec 20 2007
u(2)=1, v(2)=1, u(n)=2*v(n-1), v(n)=u(n-1), a(n)=u(n)+v(n). - Jaume Oliver Lafont, May 21 2008
For n => 3, a(n) = sqrt(2*a(n-1)^2 + (-2)^(n-3)). - Richard R. Forberg, Aug 20 2013
a(n) = A064216(A246360(n)). - Antti Karttunen, Sep 23 2014
a(n) = sqrt((17 - (-1)^n)*2^(n-4)) for n >= 2. - Anton Zakharov, Jul 24 2016
Sum_{n>=1} 1/a(n) = 8/3. - Amiram Eldar, Nov 12 2020
a(n) = 2^(n/2) if n is even. a(n) = 3 * 2^((n-3)/2) if n is odd and for n>1. - Karl-Heinz Hofmann, Sep 08 2022

Extensions

Corrected and extended by Joe Keane (jgk(AT)jgk.org), Feb 20 2000

A246361 Numbers n such that if 2n-1 = product_{k >= 1} (p_k)^(c_k), then n >= product_{k >= 1} (p_{k-1})^(c_k), where p_k indicates the k-th prime, A000040(k).

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 13, 14, 17, 18, 23, 25, 26, 28, 32, 33, 38, 39, 41, 43, 50, 53, 58, 59, 61, 63, 68, 73, 74, 77, 83, 86, 88, 93, 94, 95, 98, 104, 113, 116, 122, 123, 128, 131, 137, 138, 140, 143, 149, 158, 163, 167, 172, 173, 176, 179, 182, 185, 188, 193, 194, 200, 203, 212, 213, 215, 218, 221, 228, 230, 233
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2014

Keywords

Comments

Numbers n such that A064216(n) <= n.
Numbers n such that A064989(2n-1) <= n.
The sequence grows as:
a(100) = 332
a(1000) = 3207
a(10000) = 34213
a(100000) = 340703
a(1000000) = 3388490
suggesting that overall, less than one third of natural numbers appear in this sequence, and more than two thirds in the complement, A246362. See also comments in the latter.

Examples

			1 is present, as 2*1 - 1 = empty product = 1.
12 is not present, as (2*12)-1 = 23 = p_9, and p_8 = 19, with 12 < 19.
14 is present, as (2*14)-1 = 27 = p_2^3 = 8, and 14 >= 8.
		

Crossrefs

Complement: A246362.
Union of A246371 and A048674.
Subsequence: A246360.

Programs

  • PARI
    default(primelimit, 2^30);
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A064216(n) = A064989((2*n)-1);
    isA246361(n) = (A064216(n) <= n);
    n = 0; i = 0; while(i < 10000, n++; if(isA246361(n), i++; write("b246361.txt", i, " ", n)));
    (Scheme, with Antti Karttunen's IntSeq-library)
    (define A246361 (MATCHING-POS 1 1 (lambda (n) (<= (A064216 n) n))))

A246347 Record values in A135141.

Original entry on oeis.org

1, 2, 4, 8, 9, 17, 19, 35, 39, 71, 79, 143, 159, 287, 319, 575, 639, 1151, 1279, 2303, 2559, 4607, 5119, 9215, 10239, 18431, 20479, 36863, 40959, 73727, 81919, 147455, 163839, 294911, 327679, 589823, 655359, 1179647, 1310719, 2359295, 2621439, 4718591, 5242879, 9437183, 10485759
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2014 after Robert G. Wilson v's note in A135141

Keywords

Comments

In binary, the terms of the sequence seem to follow a simple pattern:
1 = a(1)
10 = a(2)
100 = a(3)
1000 = a(4)
1001 = a(5)
10001 = a(6)
10011 = a(7)
100011 = a(8)
100111 = a(9)
1000111 = a(10)
1001111 = a(11)
10001111 = a(12)
10011111 = a(13)
100011111 = a(14)
100111111 = a(15)
...
thus the sequence seems to consist of, after 1 and 2, an interleaving of sequence A153894: 4, 9, 19, 39, 79, 159, 319, ... with the sequence A052996 from its third term onward: 8, 17, 35, 71, 143, ...

Crossrefs

A246346 gives the corresponding positions in A135141.

Programs

  • Mathematica
    Union[FromDigits[#,2]&/@Flatten[Table[{PadRight[{1,0,0},n,1],PadRight[ {1,0,0,0},n,1]},{n,30}],1]] (* Harvey P. Dale, May 03 2015 *)
  • PARI
    \\ See code in A246348.
    
  • Scheme
    (define (A246347 n) (A135141 (A246346 n)))

Formula

a(n) = A135141(A246346(n)).

A247283 Positions of subrecords in A048673.

Original entry on oeis.org

5, 7, 9, 15, 18, 27, 36, 54, 72, 108, 144, 216, 288, 432, 576, 864, 1152, 1728, 2304, 3456, 4608, 6912, 9216, 13824, 18432, 27648, 36864, 55296, 73728, 110592, 147456, 221184, 294912, 442368, 589824, 884736, 1179648, 1769472, 2359296, 3538944, 4718592, 7077888
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2014

Keywords

Comments

Odd bisection seems to be A116453 (i.e. A005010, 9*2^n from a(3)=9 onward).
After terms 7 and 15, even bisection from a(6)=27 onward seems to be A175806 (27*2^n).

Examples

			The fourth (A246360(4) = 5) and the fifth (A246360(5) = 8) record of A048673 (1, 2, 3, 5, 4, 8, ...) occur at A029744(4) = 4 and A029744(5) = 6 respectively. In range between, the maximum must occur at 5, thus a(4-3) = a(1) = 5. (All the previous records of A048673 are in consecutive positions, 1, 2, 3, 4, thus there are no previous subrecords).
The ninth (A246360(9) = 68) and the tenth (A246360(10) = 122) record of A048673 occur at A029744(9) = 24 and A029744(10) = 32 respectively. For n in range 25 .. 31 the values of A048673 are: 25, 26, 63, 50, 16, 53, 19, of which 63 is the maximum, and because it occurs at n = 27, we have a(9-3) = a(6) = 27.
		

Crossrefs

A247284 gives the corresponding values.

Programs

  • PARI
    \\ Compute A245449, A246360, A247283 and A247284 at the same time:
    default(primelimit,(2^31)+(2^30));
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A048673(n) = (A003961(n)+1)/2;
    n = 0; i2 = 0; i3 = 0; ir = 0; prevmax = 0; submax = 0; while(n < 2^32, n++; a_n = A048673(n); if((A048673(a_n) == n), i2++; write("b245449.txt", i2, " ", n)); if((a_n > prevmax), if(submax > 0, i3++; write("b247283.txt", i3, " ", submaxpt); write("b247284.txt", i3, " ", submax)); prevmax = a_n; submax = 0; ir++; write("b029744_empirical.txt", ir, " ", n); write("b246360_empirical.txt", ir, " ", a_n), if((a_n > submax), submax = a_n; submaxpt = n)));
    
  • Scheme
    (definec (A247283 n) (max_pt_in_range A048673 (+ (A029744 (+ n 3)) 1) (- (A029744 (+ n 4)) 1)))
    (define (max_pt_in_range intfun lowlim uplim) (let loop ((i (+ 1 lowlim)) (maxnow (intfun lowlim)) (maxpt lowlim)) (cond ((> i uplim) maxpt) (else (let ((v (intfun i))) (if (> v maxnow) (loop (+ 1 i) v i) (loop (+ 1 i) maxnow maxpt)))))))

Formula

a(n) = A064216(A247284(n)).
Conjectures from Chai Wah Wu, Jul 30 2020: (Start)
a(n) = 2*a(n-2) for n > 6.
G.f.: x*(3*x^5 - x^3 + x^2 - 7*x - 5)/(2*x^2 - 1). (End)

A247284 Subrecords in A048673: maximum value between two consecutive records in A048673.

Original entry on oeis.org

4, 6, 13, 18, 38, 63, 113, 188, 338, 563, 1013, 1688, 3038, 5063, 9113, 15188, 27338, 45563, 82013, 136688, 246038, 410063, 738113, 1230188, 2214338, 3690563, 6643013, 11071688, 19929038, 33215063, 59787113, 99645188, 179361338, 298935563, 538084013, 896806688
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2014

Keywords

Examples

			The fourth (A246360(4) = 5) and the fifth (A246360(5) = 8) record of A048673 (1, 2, 3, 5, 4, 8, ...) occur at A029744(4) = 4 and A029744(5) = 6 respectively. In range between, the maximum must occur at 5, where A048673(5) = 4, thus a(4-3) = a(1) = 4. (All the previous records of A048673 are in consecutive positions, 1, 2, 3, 4, thus there are no previous subrecords).
The ninth (A246360(9) = 68) and the tenth (A246360(10) = 122) record of A048673 occur at A029744(9) = 24 and A029744(10) = 32 respectively. For n in range 25 .. 31 the values of A048673 are: 25, 26, 63, 50, 16, 53, 19, of which 63 is the maximum, thus a(9-3) = a(6) = 63.
		

Crossrefs

A247283 gives the corresponding positions.

Programs

Formula

a(n) = A048673(A247283(n)).
Conjectures from Chai Wah Wu, Jul 30 2020: (Start)
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) for n > 7.
G.f.: x*(-10*x^6 + 10*x^5 - x^4 - x^3 - 5*x^2 + 2*x + 4)/((x - 1)*(3*x^2 - 1)). (End)

A357302 Numbers k such that k^2 can be represented as x^2 + x*y + y^2 in more ways than for any smaller k.

Original entry on oeis.org

1, 7, 49, 91, 637, 1729, 12103, 53599, 375193, 1983163, 13882141, 85276009, 596932063, 4178524441, 5201836549, 36412855843, 254889990901, 348523048783, 2439661341481, 17077629390367, 25442182561159, 178095277928113, 1246666945496791, 2009932422331561, 14069526956320927
Offset: 1

Views

Author

Hugo Pfoertner, Sep 25 2022

Keywords

Comments

Apparently the number of grid points t(n) = {1, 2, 3, 5, 8, 14, 23, ...} (A357303) in the reduced representations as described in the examples matches t(n) = A087503(n-3) + 2 for n >= 3, i.e., t(n) = t(n-1) + 3*t(n-2) - 3*t(n-3) for n >= 5. This coincidence persists up to t(15) = 1823, but t(16) = 2553, whereas the recurrence predicts 3281, which is t(17). It seems that all of the terms generated by the recurrence also appear as record numbers of grid points. However, there are other record numbers in between, of which 2553 is the first occurrence.

Examples

			The essential information in the complete set of representations of a square a(n)^2 can be extracted by taking into account the symmetries of the triangular lattice. If r is the number of all representations of a(n)^2, then there are t = (r/6 + 1)/2 pairs of triangular oblique coordinates lying in a sector of angular width Pi/6 completely containing the essential information.
a(1) = 1: r = 6 representations of 1^2 are [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0] reduced: (6/6 + 1)/2 = 1 grid point [1,0].
a(2) = 7: r = 18 representations of 7^2 = 49 are [-8, 5], [-7, 0], [-7, 7], [-5, -3], [-5, 8], [-3, -5], [-3, 8], [0, -7], [0, 7], [3, -8], [3, 5], [5, -8], [5, 3], [7, -7], [7, 0], [8, -5], [8, -3], [8, 3]; reduced: (18/6 + 1)/2 = 2 grid points [7, 0], [8, 3].
After a(2) = 7 there are no squares with more than 18 representations, e.g., r = 18 for 13^2, 14^2, 19^2, 21^2, ..., 42^2, 43^2.
a(3) = 49: r = 30 representations of 49^2 = 2401 are [-56, 21], [-56, 35], [-55, 16], [-55, 39], [-49, 0], [-49, 49], [-39, -16], [-39, 55], [-35, -21], [-35, 56], [-21, -35], [-21, 56], [-16, -39], [-16, 55], [0, -49], [0, 49], [16, -55], [16, 39], [21, -56], [21, 35], [35, -56], [35, 21], [39, -55], [39, 16], [49, -49], [49, 0], [55, -39], [55, -16], [56, -35], [56, -21]; reduced: (30/6 + 1)/2 = 3 grid points [49, 0], [55, 16], [56, 21].
There are no squares with r > 18 between 49 and 90.
a(4) = 91: r = 54 representations of 91^2 = 8281 are [-105,49], [-105,56], ..., [105, -56], [105,-49]; reduced: (54/6 + 1)/2 = 5 grid points [91, 0], [96, 11], [99, 19], [104, 39], [105, 49].
		

Crossrefs

Programs

  • PARI
    a357302(upto) = {my (dmax=0);for (k = 1, upto, my (d = #qfbsolve (Qfb(1,1,1), k^2, 3)); if(d > dmax, print1(k,", "); dmax=d))};
    a357302(400000)
    
  • PARI
    \\ more efficient using function list_A344473 (see there)
    a355703(maxexp10)= {my (sqterms=select(x->issquare(x), list_A344473 (10^(2*maxexp10))), r=0); for (k=1, #sqterms, my (d = #qfbsolve(Qfb(1,1,1),v[k],3)); if (d>r, print1(sqrtint(v[k]),", "); r=d))};
    a355703(17)
    
  • Python
    from itertools import count, islice
    from sympy.abc import x,y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A357302_gen(): # generator of terms
        c = 0
        for k in count(1):
            if (d:=len(diop_quadratic(x*(x+y)+y**2-k**2))) > c:
                yield k
                c = d
    A357302_list = print(list(islice(A357302_gen(),6))) # Chai Wah Wu, Sep 26 2022

A344841 a(n) is the least positive number not of the form a(k) XOR ... XOR a(m) with 1 <= k <= m < n (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

1, 2, 4, 5, 8, 12, 14, 16, 17, 19, 20, 21, 23, 32, 33, 35, 48, 49, 51, 56, 57, 59, 64, 65, 67, 68, 69, 71, 76, 77, 79, 80, 81, 83, 84, 85, 87, 92, 93, 95, 128, 129, 131, 132, 133, 135, 140, 141, 143, 192, 193, 195, 196, 197, 199, 204, 205, 207, 224, 225, 227
Offset: 1

Views

Author

Rémy Sigrist, May 29 2021

Keywords

Comments

This sequence has similarities with A002048; here we use XOR, there addition.
All powers of 2 appear.

Examples

			  n   a(n)  a(k) XOR ... XOR a(n) for k=1..n
  --  ----  -------------------------------------
   1     1  1
   2     2  3, 2
   3     4  7, 6, 4
   4     5  2, 3, 1, 5
   5     8  10, 11, 9, 13, 8
   6    12  6, 7, 5, 1, 4, 12
   7    14  8, 9, 11, 15, 10, 2, 14
   8    16  24, 25, 27, 31, 26, 18, 30, 16
   9    17  9, 8, 10, 14, 11, 3, 15, 1, 17
  10    19  26, 27, 25, 29, 24, 16, 28, 18, 2, 19
		

Crossrefs

Programs

  • PARI
    s=2^0; for (n=1, #a=vector(61), print1 (a[n]=valuation(s+1, 2)", "); z=0; forstep (k=n, 1, -1, s=bitor(s, 2^z=bitxor(z,a[k]))))
    
  • Python
    from operator import xor
    from itertools import count, accumulate, islice
    from collections import deque
    def A344841_gen(): # generator of terms
        aset, alist = set(), deque()
        for k in count(1):
            if k in aset:
                aset.remove(k)
            else:
                yield k
                aset |= set(k^d for d in accumulate(alist,xor))
                alist.appendleft(k)
    A344841_list = list(islice(A344841_gen(),60)) # Chai Wah Wu, Sep 01 2025

Formula

Apparently, a(A246360(k)) = 2^(k-1) for any k > 0.

A357303 Records in the numbers of representations of k^2 as x^2 - x*y + y^2, x > 2*y >= 0, corresponding to the numbers of grid points with squared radius A357302(n)^2 in an angular sector 0 <= phi < Pi/6 of the triangular lattice.

Original entry on oeis.org

1, 2, 3, 5, 8, 14, 23, 41, 68, 122, 203, 365, 608, 851, 1094, 1823, 2552, 3281, 5468, 7655, 9842, 16403, 22964, 29525, 49208, 68891, 82013, 88574, 114818, 147623, 206672, 246038, 265721
Offset: 1

Views

Author

Hugo Pfoertner, Sep 25 2022

Keywords

Comments

The total number of possible representations of A357302(n)^2 = x^2 + x*y + y^2 with integers x,y is 12*a(n) - 6.

Examples

			See A357302.
		

Crossrefs

A246360 seems to be a subsequence.
Cf. A087503.

Programs

  • Mathematica
    records[n_] := Module[{ri = n, m = 0, rcs = {}, len}, len = Length[ri];
       While[len > 0, If[First[ri] > m, m = First[ri]; AppendTo[rcs, m]];
        ri = Rest[ri]; len--]; rcs]; (* after Harvey P. Dale in A336679 *)
    records[Table[
      Length[FindInstance[
        x^2 - x*y + y^2 == k^2 && x > 2*y && y >= 0, {x, y}, Integers,
        1000]], {k, 0, 2000}]]
Showing 1-9 of 9 results.