A024613 Duplicate of A024606.
7, 13, 19, 21, 28, 31, 37, 39, 43, 49, 52, 57, 61, 63, 67, 73, 76, 79, 84, 91, 93, 97, 103, 109
Offset: 1
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.
[n: n in [1..500] | forall{d: d in PrimeDivisors(n) | d mod 3 eq 1}]; // Vincenzo Librandi, Aug 21 2012
with(numtheory): for n from 1 to 1801 by 6 do it1 := ifactors(n)[2]: it2 := 1: for i from 1 to nops(it1) do if it1[i][1] mod 6 > 1 then it2 := 0; break fi: od: if it2=1 then printf(`%d,`,n) fi: od: with(numtheory): cnt:=0: L:=[]: for w to 1 do for n from 1 while cnt<100 do dn:=divisors(n); Q:=map(z-> n+z+1, dn); if andmap(z-> z mod 3 = 0, Q) then cnt:=cnt+1; L:=[op(L),[cnt,n]]; fi; od od; L; # Walter Kehowski, Aug 09 2006
ok[1]=True;ok[n_]:=And@@(Mod[#,3]==1&)/@FactorInteger[n][[All,1]];Select[Range[500],ok] (* Vincenzo Librandi, Aug 21 2012 *) lst={}; maxLen=331; Do[If[Reduce[m^2+m*n+n^2==k^2&&m>=n>=0&&GCD[k, m, n]==1, {m, n}, Integers]===False, Null[], AppendTo[lst, k]], {k, maxLen}]; lst (* Frank M Jackson, Jul 04 2013 from A034017 *)
is(n)=my(f=factor(n)[,1]);for(i=1,#f,if(f[i]%3!=1,return(0)));1 \\ Charles R Greathouse IV, Feb 06 2013
list(lim)=my(v=List([1]), mn, mx, t); forprime(p=7, lim\=1, if(p%6==1, listput(v, p))); if(lim<49, return(Vec(v))); forprime(p=7, sqrtint(lim), if(p%6>1, next); mx=1; while(v[mx+1]*p<=lim, for(i=mn=mx+1, mx=#v, t=p*v[i]; if(t>lim, break); listput(v, t)))); Set(v) \\ Charles R Greathouse IV, Jan 11 2018
3 = 1^2 + 1^2 + 1*1, 7 = 2^2 + 1^2 + 2*1, ...
function isA024614(n) n % 3 >= 2 && return false n == 3 && return true M = Int(round(2*sqrt(n/3))) for y in 2:M, x in 1:y n == x^2 + y^2 + x*y && return true end return false end A024614list(upto) = [n for n in 1:upto if isA024614(n)] println(A024614list(228)) # Peter Luschny, Mar 02 2018 updated Mar 17 2018
isA024614 := proc(n) local i,j,disc; # n=i^2+j^2-i*j = (j-i)^2+i*j, 1<=i=1 and i*j>=j and i^2+j^2-i*j >= 1+j max search radius for j from 2 to n-1 do # i=(j +- sqrt(4n-3j^2))/2 disc := 4*n-3*j^2 ; if disc >= 0 then if issqr(disc) then i := (j+sqrt(disc))/2 ; if type(i,'integer') and i >= 1 and i = 1 and i A024614(t) then printf("%d %d\n",n,t) ; n := n+1 ; end if; end do: # R. J. Mathar, Aug 21 2016 # second Maple program: a:= proc(n) option remember; local k, x; for k from a(n-1)+1 do for x while x^2 x^2+(x+y)*y=k)((isqrt(4*k-3*x^2)-x)/2) then return k fi od od end: a(0):=0: seq(a(n), n=1..200); # Alois P. Heinz, Mar 02 2018
max = 228; T0 = {}; xm = Ceiling[Sqrt[max]]; While[T = T0; T0 = Table[x^2 + x y + y^2, {x, 1, xm}, {y, x, xm}] // Flatten // Union // Select[#, # <= max&]&; T != T0, xm = 2 xm]; T (* Jean-François Alcover, Mar 23 2018 *)
is(n)={n>2&&!for(i=1, #n=Set(Col(factor(n)%6))/*consider prime factors mod 6*/, n[i][1]>1||next/*skip factors = 1 mod 6*/; /* odd power: ok only if p=3 */n[i][2]%2&&(n[i][1]!=3 || next) && return; /*even power: ok if there's a p==1, listed first*/ n[1][1]==1 || /*also ok if it's not a 3 and if there's a 3 elsewhere */ (n[i][1]==2 && i<#n && n[i+1][1]==3) || (n[i][1]>3 && for(j=1,i-1,n[j][1]==3 && next(2))||return))} \\ M. F. Hasler, Aug 17 2016, documented & bug fixed (following an observation by Altug Alkan) Mar 04 2018
is(n)={(n=factor(n))||return/*n=1*/; /*exponents % 2, primes % 3*/ n[,2]%=2; n[,1]%=3; (n=Set(Col(n))) /*odd power of a prime == 2? will be last*/ [#n][2] && n[#n][1]==2 && return; /*factor == 1? will be 1st or after 3*/ n[1+(!n[1][1] && #n>1)][1]==1 || /*thrice a square?*/ (!n[1][1]&&n[1][2]&&!for(i=2,#n,n[i][2]&&return))} \\ Alternate code, 5% slower, maybe a bit less obscure. - M. F. Hasler, Mar 04 2018
N=228; v=vector(N); for(x=1,N, x2=x*x; if(x2>N,break); for(y=x,N, t=x2+y*(x+y); if(t>N,break); v[t]=1;)); for(n=1,N,if(v[n],print1(n,", "))); \\ Joerg Arndt, Mar 10 2018
list(lim)=my(v=List(), x2); lim\=1; for(x=1, sqrtint(4*lim\3), x2=x^2; for(y=1, min((sqrt(4*lim-3*x2)-x)/2, x), listput(v, y*(x+y)+x2))); Set(v) \\ Charles R Greathouse IV, Mar 23 2018
a050931 n = a050931_list !! (n-1) a050931_list = filter (any (== 1) . map (flip mod 6) . a027748_row) [1..] -- Reinhard Zumkeller, Apr 09 2014
Select[Range[2,200],MemberQ[Union[Mod[#,6]&/@FactorInteger[#][[All,1]]],1]&] (* Harvey P. Dale, Aug 24 2019 *)
is_A050931(n)=n>6&&Set(factor(n)[,1]%6)[1]==1 \\ M. F. Hasler, Mar 04 2018
a(2) = 91 = 1^2 + 1*9 + 9^2 = 5^2 + 5*6 + 6^2; a(45) = 931 = 1^2+1*30+30^2 = 9^2+9*25+25^2 = 14^2+14*21+21^2; a(97) = 1729 = 3^2+3*40+40^2 = 8^2+8*37+37^2 = 15^2+15*32+32^2 = 23^2+23*25+25^2. - _Reinhard Zumkeller_, Oct 30 2011
a118886 n = a118886_list !! (n-1) a118886_list = filter ((> 1) . a088534) a003136_list -- Reinhard Zumkeller, Oct 30 2011
function isA118886(n) n < 49 && return false n % 3 == 2 && return false M = Int(round(2*sqrt(n/3))) count = 0 for y in 0:M, x in 0:y n == x^2 + y^2 + x*y && (count += 1) count == 2 && break end return count >= 2 end A118886list(upto) = [n for n in 0:upto if isA118886(n)] A118886list(1099) |> println # Peter Luschny, Mar 17 2018
amax = 2000; xmax = Sqrt[amax] // Ceiling; Clear[f]; f[_] = 0; Do[q = x^2 + x y + y^2; f[q] = f[q] + 1, {x, 0, xmax}, {y, x, xmax}]; A118886 = Select[Range[0, 3 xmax^2], # <= amax && f[#] > 1&] (* Jean-François Alcover, Jun 21 2018 *)
is(n)=#bnfisintnorm(bnfinit(z^2+z+1), n) > 2; select(is, vector(1500,j,j)) \\ Joerg Arndt, Jan 11 2015
a(1)= 7 = 2^2+2+1, a(2)= 13 = 3^2+3+1. However 3 = 1+1+1 and 4 = 2^2+0*2+0 are not in the sequence because the unique decomposition of these numbers is not with two distinct nonzero numbers; 49, 147 are also excluded because there are two decompositions of these numbers (including one with equal or zero components x and y).
r[k_] := Reduce[x != 0 && y != 0 && x != y && k == x^2 + x y + y^2, {x, y}, Integers]; selQ[k_] := If[IntegerQ[Sqrt[k]], False, Which[rk = r[k]; rk === False, False, rk[[0]] === And && Length[rk] == 2, True, rk[[0]] === Or && Length[rk] == 12, True, True, False]]; Select[Range[1000], selQ] (* Jean-François Alcover, Feb 20 2020 *)
n a(n) (u, v=u+w, w) [x, y,z] A236300 member 1: 14 (1, 3, 2) [4, 3, 1] 8*7 = 56 2: 26 (1, 4, 3) [5, 4, 1] 10*13 = 130 3: 38 (2, 5, 3) [7, 5, 2] 14*19 = 266 4: 42 (1, 5, 4) [6, 5, 1] 12*21 = 252 5: 56 (2, 6, 4) [8, 6, 2] 16*28 = 448 6: 62 (1, 6, 5) [7, 6, 1] 14*31 = 434 7: 74 (3, 7, 4) [10, 7, 3] 20*37 = 740 8: 78 (2, 7, 5) [9, 7, 2] 18*39 = 702 9: 86 (1, 7, 6) [8, 7, 1] 16*43 = 688 10: 98 (3, 8, 5) [11, 8, 3] 22*49 = 1078 ... For n=11 .. 20 see the link.
49 is not in the sequence because 49 = 3^2+3*5+5^2.
selQ[1] = True; selQ[n_] := Module[{f = FactorInteger[n]}, FreeQ[f, {p_, q_} /; Mod[p, 6] == 1 || Mod[p, 3] == 2 && OddQ[q]]]; Select[Range[2500], selQ] (* Jean-François Alcover, Nov 25 2013, after first comment *)
Comments